The Temple of Fu

code, systems and games

Archive for the ‘MySQL’ Category

Start MySQL daemon on boot

leave a comment »

In order to start the MySQL daemon at boot time one must add it to the system’s boot up process. Note this only works on SysV init runlevel systems.

Run the following command as root.

chkconfig mysqld on
or the more verbose where you specify the runlevel
chkconfig mysqld --level 2345 on

To clarify, a runlevel determines what services are started when a Linux computer is booted. When you boot into runlevel 1, only the core system files are loaded similar to Windows Safe Mode. Runlevel 2 is there if you want to create a custom runlevel the same as Runlevel 4. Runlevel 3 is what most servers boot to and it starts all of your services and other things required for a true multi-user environment. Runlevel 5 is for starting a GUI and this is what most desktop systems boot to.

You can then check that MySQL is enabled to start by running the following command. Again run this command as root.

chkconfig --list

That’s it!

Written by lordfu

March 20, 2010 at 11:26 pm

Posted in Database, MySQL, RedHats

Reset MySQL root password

with one comment

#service mysqld stop
#/usr/bin/mysqld_safe --skip-grant-tables &
#mysql --user=root mysql
mysql>update user set Password=PASSWORD('new-password-here') WHERE User='root';
mysql>flush privileges;

Kill the mysqld_safe process


Then restart MySQL
#service mysqld restart

Written by lordfu

March 20, 2010 at 11:25 pm