Khanh Hoang - Kenn
Kenn is a user experience designer and front end developer who enjoys creating beautiful and usable web and mobile experiences.
After you've installed MySQL it's often a good and convenient idea to make it start and stop automatically with the machine. These instructions are specific for Red Hat Linux and it's variants since different Linux distributions tend to layout the start up scripts differently.
The example script is based on my MySQL installation instructions.
su root
cd /usr/local/mysql
cp support-files/mysql.server /etc/rc.d/init.d/mysql
cd /etc/rc.d/rc3.d ln -s ../init.d/mysql S85mysql cd /etc/rc.d/rc5.d ln -s ../init.d/mysql S85mysql
cd /etc/rc.d/rc0.d ln -s ../init.d/mysql K85mysql cd /etc/rc.d/rc6.d ln -s ../init.d/mysql K85mysql
cd ../init.d chmod +x mysql
shutdown -r now
cd /usr/local/mysql bin/mysqladmin -uroot -p[admin password eg. mypass] ping
Hopefully you get this response:
mysqld is alive
If you get a message like this then something went wrong:
mysqladmin: connect to server at 'localhost' failed error: 'Can't connect to local MySQL server (2)' Check that mysqld is running and that the socket '/tmp/mysql.sock' exists!
Bình luận (0)
Add Comment