I have error when try run mysql server - mysql

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

Related

Completely locked out of root in MySQL

When trying to start mysql, I receive the following error message:
ERROR 3118 (HY000): Access denied for user 'root'#'localhost'. Account is locked.
I've installed MySQL via homebrew on my OSX and have not encountered such an issue until yesterday. When I try to run mysqld_safe, I receive:
mysqld_safe mysqld from pid file /usr/local/var/mysql/****.pid ended.
If I try sudo mysqld stop, I receive:
Fatal error: Please read "Security" section of the manual to find out how to run mysqld as root!
I am unable to sudo restart mysql.server as I receive:
ERROR! MySQL server PID file could not be found!
I looked into running a data dump of my db but I am prevented from doing this as well.
Thanks for your attention to this matter and any insight you can provide in this matter. I greatly appreciate it.

MySQLd doesn't start after brew upgrade from 5.6 to 5.7

a few days back I let brew update all my formulars like always but this time mysqld doesn't start back up again.
This is the error message:
2016-03-22T13:58:22.515719Z 0 [ERROR] Fatal error: mysql.user table is damaged. Please run mysql_upgrade.
2016-03-22T13:58:22.515819Z 0 [ERROR] Aborting
But since I cannot get the server started, I cannot get mysql_upgrade running:
mysql_upgrade: Got error: 2013: Lost connection to MySQL server at 'reading initial communication packet', system error: 102 while connecting to the MySQL server
Upgrade process encountered error and will not continue.
So what can I do to get this working again? Would a brew uninstall mysql and reinstall help in any way?
First, start your mysql without reading the user table:
mysqld --skip-grant-tables
Then run mysql_upgrade which should now run smoothly.
Next stop mysqld: killall mysqld.
Now you should be able to start up your mysql service normally again.
I ended up renaming my database folder, run mysql_install_db, copy the new mysql database folder to my old mysql database folder and started it again. I'm sure this is hella dirty but well, it worked :)

Installing MySQL on El Capitan

I am attempting a fresh install of mysql on a new iMac running OSX 10.11. I downloaded the latest 10.10 dmg and followed installation directions, but when I try to run mysql, I get the
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2).
I have spent several hours reading answers here and elsewhere as to how to fix it, and nothing has worked so far.
What I know:
The /tmp/mysql.sock file has been renamed /tmp/mysql.sock.lock. Apparently, if I could get mysqld to run, it would make a new socket file, but when I try to get mysqld to run (either from the Terminal or System Preferences) it just fails and produces the same error. Likewise, when I try to run mysqladmin it fails and produces the same error.
When I run mysqld_safe, it produces the following, but doesn’t clear up the socket error:
151206 16:40:20 mysqld_safe Logging to '/usr/local/mysql/data/XXXXXXs-iMac.err'.
151206 16:40:20 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data
151206 16:42:01 mysqld_safe mysqld from pid file /usr/local/mysql/data/XXXXXXs-iMac.pid ended
When I ran mysql on Lion, I was always able to clear up socket errors by running mysqld_safe.
Advice?
Run the command 'sudo mysqld' from the command line to launch the server.

Wampserver - Error establishing a database connection

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.

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).