Install binary MySql in Linux

Source: Internet
Author: User

Install MySQL binary

Note that the MySQL RPM package can be successfully installed on the Linux Personal Edition, but installing MySQL on Enterprise as4 is a little troublesome. Even if it is installed, there are problems. Therefore, I personally recommend that you install binary MySQL on the Enterprise Edition.

1. Download the binary MySQL installation package from the http://www.mysql.com // This MySQL is a binary version, do not compile

Linux (x86) 5.0.41 59.6 M download | pick a mirror
Mysql-5.0.41-linux-i686-glibc23.tar.gz

2. # chmod 755 mysql-5.0.41-linux-i686-glibc23.tar.gz
//
3. # tar xfz mysql-5.0.41-linux-i686-glibc23.tar.gz // copy the directory generated after decompression to/usr/local/and rename it MySQL

4. # groupadd MySQL
# Useradd mysql-G MySQL // create a MySQL Group
// Create a MySQL user and add it to the MySQL Group
5 .. # 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)
6. # cd/usr/local/MySQL
#./Scripts/mysql_install_db -- user = MySQL
Go to the MySQL directory
// Create a table and use a MySQL user to access the table. After the table is initialized, set the access permissions for MySQL and root users.
7. # chown-r root. // set root to access/usr/local/MySQL
8. # chown-r Mysql Data

// Set the MySQL user to access/usr/local/MySQL/data, which stores MySQL database files. this directory is in/etc/My. CNF is configured and generated in mysql_install_db.
9. # chown-r Mysql Data /.

// Set the MySQL user to access all files in/usr/local/MySQL/data/MySQL
10. # chgrp-r MySQL.

// Set the MySQL group to access/usr/local/MySQL
11. #/usr/local/MySQL/bin/mysqld_safe -- user = MySQL &
Run MySQL
[Stop Service #/usr/local/MySQL/bin/mysqladmin-uroot-p123 +-*/shutdown]
If there is no problem, a prompt like this should appear:
[1] 42264
# Starting mysqld daemon with databases from/usr/local/MySQL/var
If a statement such as MySQL ended is displayed, it indicates that MySQL is not started normally. You can find the problem in log. The log file is usually configured in/etc/My. CNF. Most problems are caused by incorrect permission settings.
12. Run the following command to modify the MySQL password:
#/Usr/local/MySQL/bin/mysqladmin-u Root Password yourpassword // The default installation password is blank. You must change it immediately for security purposes.
13. # cp support-files/MySQL. Server/etc/rc. d/init. d/mysqld
# Chmod 700/etc/init. d/mysqld
# Chkconfig -- add mysqld
# Chkconfig -- level 345 mysqld on // copy a script in the compilation directory
// Set to enable MySQL to run automatically every time it is started
14. # service mysqld start
# Netstat-atln
// Start the mysqld 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.

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.