Can't connect to database - mysql

Actually I'm having more than one problem...but all of it has to do with connecting or working with the MySQL database...First you can see one of the errors on my website and no matter what you choose it seems to just say it can't connect to the database...I've configured a configure.php file to allow files to connect to the MySQL database...see the website here:
http://netsurfer123.byethost11.com/index.php
Then when I try to log-in to the Admin area of my MySQL database it just says:
phpMyAdmin - Error
Cannot start session without errors, please check errors given in your PHP and/or webserver log file and configure your PHP installation properly.
Please let me know what I can do to correct these errors...and thanks very much in advanced for any helpful response/s.

First you need to check if the MySQL server is actually running. Use a command such as
/etc/rc.d/init.d/mysqld status
Or similar for your system if possible.

Did you check the web server log file? Does it contain errors as indicated by phpMyAdmin?
Your site is simply unable to connect to the database to which it's trying to connect. This could be for any number of potential reasons:
Is the database running?
Is the database accessible by that machine? (Maybe there's a firewall in between the two servers, if they're separated?)
If the database is on that same machine, are you connecting to it properly? (Maybe it allows only certain connection methods, such as a socket vs. the loopback address?)
Is your connection string correct? Maybe the login is failing?
Check your PHP logs, your Apache logs, your MySQL logs. One of them is complaining about something and it's probably trying to tell you what.

Related

Outsystems: configuring a connection to access a MySQL database

I'm using Outsystems Service Studio to develop a web application. I need to configure a connection to access a local server database. I get "Connection String test failed: Unable to connect to any of the specified MySQL hosts." I just figured out I can't connect using "localhost", because the Outsystems server is not local, but I'm not able to find a solution. what is wrong? Other details:
MySQL Server is up and running
I selected MySQL in DBMS
Inserted my schema name
Inserted the username (with all privileges granted)
Inserted the user password
Tried both basic and advanced configuration. I inserted j"dbc:mysql://127.0.0.1:3306/mydb?user=outsystems2" as connection string parameters and I get "Connection String test failed: Keyword not supported.Parameter name: mysql://127.0.0.1:3306/mydb?user". I know this connection string can't work , but I'm not able to find a functioning one. I've read many guides about this configuration, but no solution was found. Thank you all for your time and help, feel free to ask for more details
Luciano,
Is your OutSystems environment on-premises or in the cloud? Either way, you need to make sure that this server is able to reach - it as connectivity - to your MySQL database server. Using localhost or 127.0.0.1 is pretty much the same thing as this is an address for the machine where the request is running, which is, in this case, the OutSystems server. Do you have the MySQL database on your local machine? This is not a good approach as you will need to have an address that won't change otherwise the connection won't be stable and you'd have to reconfigure it all the time.
Regards

SQlite to MySQL migration for Seafile Server

I have successfully got Seafile Server fully working with HTTPS.
However I'm trying to migrate from SQLite to MySQL and everytime I try, the seafile server stops working.
I'm not sure what information to put here that yous will need but happy to provide what ever you need.
I followed this guide Deploy Seafile Windows Server With MySQL
Its really frustrating, I dont understand why its not working. I also installed MySQL Workbench and I can see the seafile user with privileges and the databases populated with the tables.
Are there any messages in the logs?
Please look at the logs in /seafile/logs/
You will see an error message in seafile.log if you have problems with MySQL.
For example:
../common/seaf-db.c(123): Failed to get database connection:
Failed to connect to MySQL: Can't connect to MySQL server on '127.0.0.1' (107).
http-server.c(761): DB error when check repo existence.
Disconnected from daemon
I have done such migration already and it did work without problems.

Unable to connect to any of the specified MySQL hosts in NHibernate, MySql

One of the client is reporting this issue happening in our application. NHibernate throws Unable to connect to any of the specified MySQL hosts in the middle of the app running, so it is not a mistake in the configuration. It happens randomly, but always when the transaction is opened.
I saw this:
NHibernate, MySQL, Windows Server 2003 -- connection problems
But the server in my case is Windows 2008. And app opens only single connection simultaneously. MySQL version is 5.5.28. Server is on the remove machine
Unfortunately the app requires the HW I do not have, and I cannot reproduce it locally.
Any ideas or directions I need to dig in?
Try connecting using the full directory name, e.g. instead of Server=SRV use
Server=SRV.yournetwork.com
It might be that is has trouble resolving the server name.

Difference In Phpmyadmin Mysql web client and Terminal client

I got problem (#2006 Mysql server gone away) with mysql while connecting and performing some operations through web browser.
Operation Listed below:
When Executing big procedure
Importing database dump
When Access some particular tables It immediately throws "Server gone away".
Refer this question for Scenarios: Record Not Inserted - #2006 Mysql server gone away
Note : The above operations are works fine when I perform through terminal.
I tried some configuration as googing stated. That is set wait_timeout, max_allowed_packet. I checked for the bin_log but it is not available.
But the issues will not rectified.
What is the problem & How can I figure out & fix the issue?
what is the different between access phpmyadmin mysql server from web browser and terminal?
Where I can find the mysql server log file?
Note: If you know about any one of the above questions. Please post here. It would be helpful to trace.
Please help me to figure this out..
Thanks in advance...
Basically nothing except phpMyAdmin is limited by PHP's timeout and resource limits (limits to keep a runaway script from bogging down your entire machine for all eternity; see the docs for details of those values. In some cases, you might be authenticating through a different user account (for instance, root#localhost and root#127.0.0.1 aren't the same user), but as long as you're using a user with the same permissions the differences are minimal.
You can read more about logs in the MySQL manual, note that "By default, no logs are enabled (except the error log on Windows)".
Below are answer for question
From my research the problem is that browser have some limit to disconnect the connection i.e timeout connection. So that the above problem raised.
To resolve this problem
Go to /opt/lampp/phpmyadmin and open config.inc.php
add the command $cfg['ExecTimeLimit'] = 0;
Restart the xamp server. Now you can perform any operations.
`
2. Web client is differ from terminal because Terminal client will not getting timeout. Terminal client maintain the connection till the progress completed. I recommenced to use command prompt to import/export/run process by safe way.
Basically phpmyadmin will not have any log file. If you wanna see warnings and error you should configure the log file.
Configuration steps:
Go to /opt/lampp/etc/my.cnf
Add log_bin = /opt/lampp/var/mysql/filename.log
Restart the xamp server. You can get the log information.

Failed to connect to MySQL at 127.0.0.1 in MySQL Workbench. System error 61

I'm running into a little trouble with MySQL Workbench.
This is the situation, I'm developing a database to query it remotely from Android devices. This is the first time I use MySQL Workbench, so I've followed this tutorial:
http://net.tutsplus.com/tutorials/databases/visual-database-creation-with-mysql-workbench/
I have no problem creating the EER diagram and generating the SQL script. The problem comes when I try to connect to a MySQL server. I get this error:
"Failed to Connect to MySQL at 127.0.0.1:3306 with user root. Lost connection to MySQL server at 'reading initial communication packet', system error: 61"
http://img101.imageshack.us/i/capturadepantalla201104i.png/ (if the link stops working tell me)
I've also tried using the Local Socket/Pipe connection method with the MAMP Socket in '/Applications/MAMP/tmp/mysql/mysql.sock', but it gives the same error. And I've also tried using MAMP port 8889 but still nothing.
So anyone knows how to fix it? And another question, can I connect from my Android device to my laptop(where the database is placed) without using MAMP? MySQL needs MAMP to serve queries? And the last thing, am I going into the right way? Or should I do it other way?
Thanks for reading.
I had the same issue, but part of your question is what fixed it for me:
Set connection = Local Socket/Pipe
Set socket path = "/Applications/MAMP/tmp/mysql/mysql.sock" (for me - I got the path from my MySQL log upon initialisation)
Running: MBP, OSX 10.8.3 (Mountain Lion), MAMP Pro
Can't really fathom any further what your issue may be, but perhaps double check your DB is properly initialised. But, perhaps this helps someone else :)
I typed: sudo /usr/local/mysql/support-files/mysql.server start
into the terminal and it started the MySQL server successfully and I was able to connect to MYSQL workbench.
You need to sure that Mysql process is running in your system. not sure in MAC but in windows it'called mysqld.exe
well take a look
http://lists.mysql.com/mysql/124371
Most commonly happens when database/server is not running. You need to check your server, or restart it. You can do so if you have mysql workbench under server administration. Check your manual for restarting or starting the server.
On osx 10.6 using mamp pro I solved this by allowing network access in the MySQL tab from the home window. Hope it saves someone the pain too
When trying to use the MySQL Workbench and connect through an SSH tunnel, you will get this error when your SSH connection does not complete successfully (e.g. improper host, password, key file, etc)
A good way to trouble shoot this is to separately test the the ssh connection from the machine you are trying to connect from and establish that you can do so successfully.
Try closing MySQL and running it as the admin. This worked for me.
After making above improvement such as checking if mysql service is running or not, you just need to give a small password while creating connection, it is ' ' or 1 time press on space-bar in case of GUI or workbench.
After which you just need to validate your machine with server (validated HOST).
For that purpose click on 'New Server Instance' and it will configure server/HOST on your behalf itself.
I have done this successfully just a few couple of minutes ago. My workbench software is able to show all pre-installed databases etc now.
Thanks!!!
I solved it! On a mac just go to spotlight search on the top right of the screen and type Mysql. Turn it on.