Comments on: How to Change default MySQL data Directory in Linux https://tecadmin.net/change-default-mysql-data-directory-in-linux/ How to guide for System Administrator's and Developers Fri, 01 Oct 2021 09:59:50 +0000 hourly 1 https://wordpress.org/?v=6.1.1 By: Razor https://tecadmin.net/change-default-mysql-data-directory-in-linux/#comment-40674 Sun, 28 Apr 2019 18:50:21 +0000 https://tecadmin.net/?p=5197#comment-40674 Thank you it worked for me

]]>
By: Rosel https://tecadmin.net/change-default-mysql-data-directory-in-linux/#comment-19222 Tue, 07 Aug 2018 18:46:59 +0000 https://tecadmin.net/?p=5197#comment-19222 After changing data directory, is it necessary to check used mysql ports before restart services?

]]>
By: Rahul K. https://tecadmin.net/change-default-mysql-data-directory-in-linux/#comment-5199 Thu, 05 Apr 2018 03:28:57 +0000 https://tecadmin.net/?p=5197#comment-5199 What is output of “systemctl status mysqld.service”?

]]>
By: altamash https://tecadmin.net/change-default-mysql-data-directory-in-linux/#comment-5150 Fri, 23 Mar 2018 09:04:09 +0000 https://tecadmin.net/?p=5197#comment-5150 hi ,
i did the above procedure in RHEL 7 , the files were copied also i changed the ownership of mysql data directory which has the same permission as the original file but still getting an error when i restart the mysql service
stating “Job for mysqld.service failed. See ‘systemctl status mysqld.service’ and ‘journalctl -xn’ for details”

please help thanks!

]]>
By: KaZuN https://tecadmin.net/change-default-mysql-data-directory-in-linux/#comment-510 Mon, 29 Feb 2016 11:15:11 +0000 https://tecadmin.net/?p=5197#comment-510 Is any idea how its work on centos 7.cause my mysqld cannot start after done these change.thanks.

]]>
By: Jasper vS https://tecadmin.net/change-default-mysql-data-directory-in-linux/#comment-509 Tue, 22 Dec 2015 17:05:38 +0000 https://tecadmin.net/?p=5197#comment-509 Is there any reason to move the .sock file?

I mean it can be kept in the original location, right?

]]>
By: Brenda Yin https://tecadmin.net/change-default-mysql-data-directory-in-linux/#comment-508 Fri, 10 Apr 2015 03:28:00 +0000 https://tecadmin.net/?p=5197#comment-508 John,

You have to relink the sock file, which is under the new data directory.

Here is the sample:

ln -s /data/mysql/mysql.sock /var/lib/mysql/mysql.sock

]]>
By: John https://tecadmin.net/change-default-mysql-data-directory-in-linux/#comment-507 Tue, 25 Nov 2014 09:37:38 +0000 https://tecadmin.net/?p=5197#comment-507 Hi,
Thanks for the article !
I’d like to add something because I was facing an issue while trying to connect to the database after I made the changes listed above.
When I tried to connect to the database with the mysql client, I had this error :
“ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’ (2)”

The problem where that the mysql client is using by default the /var/lib/mysql/mysql.sock socket.
In the /etc/my.cnf file, I just added a client section specifying the socket :

[client]
socket=/data/mysql/mysql.sock

Hope this will help,

Cheers !

]]>
By: Rahul https://tecadmin.net/change-default-mysql-data-directory-in-linux/#comment-506 Wed, 12 Nov 2014 09:47:01 +0000 https://tecadmin.net/?p=5197#comment-506 Hi Darius,

Yes, We need to change it. We have corrected typo.

]]>
By: Darius https://tecadmin.net/change-default-mysql-data-directory-in-linux/#comment-505 Wed, 12 Nov 2014 03:36:08 +0000 https://tecadmin.net/?p=5197#comment-505 Shouldn’t the Change To: datadir=/data/mysql in this example?

]]>