How to Start Automatic Mysql service on Linux operating System
Hi Guys,
If you want to start the Mysql service automatically during the boot time of the Linux system then follows the below mentioned steps:
If you want to start the Mysql service automatically during the boot time of the Linux system then follows the below mentioned steps:
Step1:
Some vendors provide RPM packages that install a
startup script under a different name such as mysqld.So we can check also this
script is in /etc/init.d/
If it is present then we can check it is working or not
by following command.
# cd /etc/init.d/
etc/init.d# service mysqld start
#sudo apt-get install mysql-server
#cd /etc/init.d/
etc/init.d/#sudo /etc/init.d/mysqld
start
#mysql –u root –p
Password: “ Please press Enter because default password is empty”
#mysqladmin -u root password NEWPASSWORD
#mysqladmin -u root password NEWPASSWORD
#mysql –h localhost –u root
–p“newpassword”
Step2:
Then activate the script “mysqld” for automatic
start the
service in /etc/init.d/ or /etc/rc.d/init.d/
#chkconfig --add mysqld
#chkconfig –level 345 mysqld on
Step3:
Restart the system and type the following command on
terminal for checking the mysql service is running or not.
#mysql
–h localhost –u “username” –p“password”
If status is not ok:
Then To
install mysql.server RPM package.
rpm -i MySQL-server-VERSION.glibc23.i386.rpm
rpm -i MySQL-client-VERSION.glibc23.i386.rpm
Step4:
Copy the mysql file from MySQL-server-VERSION.glibc23.i386.rpm_FILES/etc/init.d/
and
place it in /etc/init.d/
Then
activate the mysql file.
#chkconfig --add mysql
#chkconfig --level 345 mysql on
Step5:
Restart the system and type the following command on terminal
Now connect the mysql using below command.
#mysql –h
localhost –u “username” –p“password”
Gud luck..:)
very nice...:)
ReplyDeleteNice , Very good way you explained hear.
ReplyDelete