The first kind of manual can be added simply to start mysql automatically, followed by a piece of shell code that has nothing to do.
mysql is set to linux service
Code is as follows
cp /usr/local/mysql5/share/mysql/mysql.server /etc/init.d/mysqld chkconfig --add mysqld chkconfig -- Level 2345 mysqld on chown mysql:mysql -R /usr/local/mysql5/service mysqld start
Here is a simple startup script v0.1 mysqldauto
The code is as follows $vi mysqldauto #!/Bin/sh # Version: 0.1 by [email protected] /opt/mysql/bin/mysqld_safe --user=mysql & #This needs to be changed to your mysqld_safe directory $chmod +x mysqldauto $mv mysqldauto /etc/rc. d/init.d/$ln -s /etc/rc.d/init.d/mysqldauto /etc/rc.d/rc3.d/S99mysqld
So we put the created mysqldauto script in /etc/Rc.d/rc3.d/below (note that the link is used here), mysqld can be started automatically.
Startup script
Code is as follows
#!/bin/sh ########################################### ####################Created by teddylu at 2012-12-12 #Used for mysql start,stop,restart ########### ###################################################################################### "root" mysql_pwd="" CmdPath="/usr/local/mysql/bin"
#startup function function_start_mysql() { printf "Starting MySQL...\ " /bin/Sh ${CmdPath}/mysqld_safe --defaults-file=/data/${port}/my.cnf 2>&1 > /dev/null & }
#stop function function_stop_mysql() { printf "Stoping MySQL...\ " ${CmdPath}/mysqladmin -u ${mysql_user} -p${mysql_pwd} -S /data/${port}/mysql.sock shutdown }
#restart function function_restart_mysql() { printf "Restarting MySQL...\ " function_stop_mysql sleep 2 function_s Tart_mysql }
case $1 in start) function_start_mysql ;; stop) function_stop_mysql ;; restart) function_restart_mysql ;; *) printf "Usage: /data/${port}/mysql {start
In Unix-like systems, you can use top to view system resources, processes, memory usage and other in
The SELinux function is an implementation of mandatory access control, which can
There is no doubt that Red Hat is indeed the choice of many companies considering Linux, but in rece
Worker. Client: The originator of the request, which can be C, PHP, Perl, MySQL UDF, etc. Job: The
Connect the USB flash drive to the VMware virtual machine Tutorial
How to open telnet function in Linux?
Linux source command and its usage introduction
Virtual Memory Management for Linux System Performance Test
Redirect command application and its syntax under Linux operating system
Ls -l | Wc -l command multiple statistics one line
Establish trust relationships between Linux machines
The use of regular expressions and grep commands under Linux
Postfix+dovecot+maildrop+mailscanner+clamav+spamassassin build
Solving the problem of high CPU usage in Windows XP system
Can the Thumbs.db file in the Win7 system be deleted?
Windows 8.1 can not complete the update error 8024054 solution
How to make mouse related settings in windows7
No group strategy to do Win7 Home Edition optimization
Crontab command using basic tutorial
Server virtualization: not just IT