Wampserver - Error establishing a database connection - mysql

After reinstalling wampserver and copying database folders from \wamp\bin\mysql\mysqlx.y.z\ to new \wamp\bin\mysql\mysqlx.y.z\data, i get this error:
Error establishing a database connection
please kindly help out.!

First Just check mysql server is running.Can you log in to MySQL with the mysql command line ? Let's start there to see if the MySQL service is running.
Sometimes it maybe a conflict with skype.If that so,first logout from the skype & the shutdown that process and after that click and restart the wamp server.

Related

Mysql installation failure to start server

Got a new laptop [Windows 11] and for the first time I am facing issues with MySQL server. It installs alright but fails at the step "Starting server".
When I check the logs on the next tab I get the error message:
Attempting to connect to Mysql#localhost:3306 with user root with no password... MySQL error 1042: Unable to connect to any of the specified MySQL hosts.
I have tried other versions, tried to start server from services, changed to Local System Account under service properties, but still the server just wont start.

MYSQL databases refusing to be accesed after reboot

Every time I reboot my computer and try to access my mysql database it produces the following error:
ERROR 2002 (HY000):
Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
any ideas on how to resolve this?
It might be that your MySQL is not started automatically on system start-up. Kindly execute mysqld to start the MySQL.
Or please refer https://askubuntu.com/questions/416309/start-mysql-on-startup, to start MySQL on system start-up, assuming that you are on Linux OS.

Starting MySql after migration Yosemite

I've run into a problem here, and I'm not sure what to do. I migrated a Yosemite Mac to a new Mac Pro. Apache turns on, but MySql does not with this error: The operation couldn’t be completed. (XAMPPErrorDomain error 1.)
I didn't know if I need to reinstall MySql or upgrade it, or what this error means. I created the plist file as in the example and ran permissions, but that did not change the outcome. Going to websites in localhost, WordPress shows an error establishing db connection.
I went to Github to install MySql and it went fine, but it does not work with Xampp and Desktop Server. I chose to NOT start MySql when I rebooted, but apparently the Github version started anyway (and I cannot find a way to turn it off!) Now when I try to start MySql from Xampp, it says another version is already running.
Any help appreciated.
When I ask for version number in terminal I get this response:
mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)'
Check that mysqld is running and that the socket: '/tmp/mysql.sock' exists!
HOWEVER, when I went to /var/ and temp I found an alias for mysql.sock, BUT it was not connected to an original file... Now that file does not exist anywhere on my computer.
Open /Applications/XAMPP/xamppfiles/xampp and add this line somewhere at the top:
unset DYLD_LIBRARY_PATH
I found that what was required was a complete uninstall of MySql following this procedure: http://bytearrays.com/completely-uninstall-mysql-mac-osx/
And then a reinstall. ServerPress.com was very helpful in diagnosing the problems.

I have error when try run mysql server

I have a vps with cpanel
and I have error when I try start de mysql server
ERROR! MySQL is not running, but lock file (/var/lock/subsys/mysql) exists
root#goldtec [~]# service mysql restart
ERROR! MySQL server PID file could not be found!
Starting MySQL.. ERROR! The server quit without updating PID file (/var/lib/mysql/goldtec.net.pid).
I don't wanna lost the data
There is an issues with you my.cnf file. I will suggest you please check your MySQL error logs file, With that logs you can find out the root cause of your issues

Can't connect to mysql. And mysql fails to restart

I have my websites on a VPS - CentOS. Suddenly all of them stopped working and are showing database connection error.
I have tried restarting mysql with the following command in SSH /etc/rc.d/init.d/mysqld restart but when it tries to stop it it says "Failed".
Any idea on what could I do?
Please check you mysql log file (/var/log/mysqld.log).