Why does MySQL not start after changing directories?

Why does MySQL not start after changing directories?

But every time I followed the instructions I get an error “ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock'” I tried moving the directory and then linking the old directory to the new one. Same error.

Why does MySQL not start in Windows 10?

The only thing that worked for me was to edit the my.ini file using Notepad++ do NOT use Windows Notepad as any change will stop mysql from starting. I would guess this is because mysql fails to parse the file, so uses internal defaults which are no good as its looking for mysql master db in ‘program files’.

Where to find MySQL service fails to start?

MySql Service fails to start, with no useful error messages appearing in the windows event logs. As far as I know, the MySql error logs are located in the datadir, so it’s not much help looking there?

Where is MySQL server 5.7 data folder located?

Made a copy of the my-default.ini file in C:\\Program Files\\MySQL\\MySQL Server 5.7 then renamed it to my.ini and edited it to look like this: Copied the contents of the original data folder into this new data folder. The MySql Service is running under the NETWORK SERVICE user, so I have given this user full control permission on the new folder.

Why does MySQL use non default datadir in enforcing mode?

This is how the /data_drive/mysql directory looks at the moment: This is likely to be an issue with SELinux. If SELinux is running in enforcing mode, you need to to persuade it to allow mysqld to use the non-default datadir.

Why do I get error when I start MySQL?

The error you are getting is not one you get from starting mysql with things in the wrong place, but from the fact that you need to modify the socket location in the [client], ` [mysqld] and any other location it shows up in, under my.cnf

How to restart mysqld as a non-root user?

Edited /etc/my.cnf to change the [mysqld] block to reflect the new location in both datadir and socket saved the file and then tried to restart the mysqld service as root user and non-root user but it won’t start.

Where to add socket path in my.cnf?

In the my.cnf you need to add the socket path in two places: In the [mysql] and in the -> [client]<- section. Once you move everything to the new folder you need to make sure that the folder has permissions and ownership mysql:mysql.