Installation and uninstallation of mysql-5.1.47 binary

Source: Internet
Author: User

Mysql of the binary version has been compiled. You do not need to perform configure, make install, or other steps. You only need to configure the mysql version and delete it directly;
Now we will introduce mysql-5.1.47-linux-i686-glibc23.tar.gz:
1. # chmod 755 mysql-5.1.47-linux-i686-glibc23.tar.gz // change the file to executable permissions
2. # tar-xvzf mysql-5.1.47-linux-i686-glibc23.tar.gz // copy the directory generated after decompression to/usr/local/and rename it mysql
3. # groupadd mysql // create a mysql Group
# Useradd mysql-g mysql // create a mysql user and add it to the mysql Group
# Cd/usr/local
# Ln-s mysql-5.1.47-linux-i686-glibc23 mysql
4 .. # cp/usr/local/mysql/support-files/my-medium.cnf/etc/my. cnf
There are four template files in the support-files directory. We select one of the Mysql configuration files to overwrite/etc/my. cnf (default system configuration, with performance parameters and some path parameters of Mysql)
5. # cd/usr/local/mysql // enter the mysql directory
#./Scripts/mysql_install_db -- user = mysql // The first trial table and requires mysql users to access the table. After the table is initialized, set the access permissions for mysql and root users.
6. # chown-R mysql data // sets the mysql user to access/usr/local/mysql/data, which stores mysql database files. this directory is in/etc/my. configuration in cnf, generated when mysql_install_db.
7. # chown-R mysql data //. // set mysql users to access all files in/usr/local/mysql/data/mysql.
8. # chgrp-R mysql. // set the mysql group to access/usr/local/mysql
9. #/usr/local/mysql/bin/mysqld_safe -- user = mysql &
10. # cd/usr/local/mysql/bin // enter the bin directory
11. # mysql // run the mysq command

If it is not started or Can't connect to local MySQL server through socket '/tmp/mysql. sock' appears'
Solution: # cd/usr/local/mysql/support-files // enter this directory
#./Mysql. server start // start to generate/tmp/mysql. sock

If the/tmp/mysql. sock file does not exist and mysql is enabled?
Solution: # netstat-an | grep 3306 // view port 3306

# Ps-ef | grep mysql // find the mysql process
# Kill-9 process number // force Delete the mysql process number
#./Mysql. server start // start to generate/tmp/mysql. sock

What if the command is not obtained by running the mysql command in any path?
Solution: Modify the/etc/profile file and add it to the file.
PATH = $ PATH:/usr/local/mysql/bin/
Export PATH (save and exit the execution of source/etc/profile)
After the preceding operations, You can execute the # mysql command in any directory.

What if I want to execute the service mysql start or restart stop command? Cannot be old #./mysql. server start
Solution: Copy mysql. server to/etc/rc. d/init. d and rename mysql or create a connection file.
Assume that the current directory is/etc/rc. d/init. d.
For example: # cp/usr/local/mysql/support-files/mysql. server mysql (copy)
Or: # ln-s/usr/local/mysql/support-files/mysql. server mysql (create a connection file)
After completing the preceding operations, You can execute service mysql start (or restart stop)
Run the following command to modify the MYSQL password:
#/Usr/local/mysql/bin/mysqladmin-u root password yourpassword // The default installation password is blank. For security purposes, you must modify it immediately.
# Chmod 700/etc/init. d/mysql
# Chkconfig -- add mysql
# Chkconfig -- level 345 mysql on // copy a script setting in the compilation directory to enable mysql to run automatically at each startup
# Service mysql start
# Netstat-atln
// Start the mysql Service
// Check whether port 3306 is enabled. Make sure that the port is opened in the firewall.

You can use telnet localhost 3306 to test whether the installation is successful.

Remote Access
Local: grant all on *. * to 'root' @ '192. 168.0.1 'identified by 'duk ';
Remote: mysql-h192.168.0.99-uroot-pdukeping

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.