Mysql installation 3 on linux (Binary installation)

Source: Internet
Author: User
Tags mysql create

Mysql installation 3 on linux (Binary installation)
Install the Binary source package:
1. Download the binary Mysql installation package from the http://www.mysql.com // This MYSQL is a binary version, do not compile

2. Change permissions
Chmod 755 mysql-5.0.41-linux-i686-glibc23.tar.gz

3. Copy the decompressed directory to/usr/local/and rename it mysql.
Tar xfz mysql-5.0.41-linux-i686-glibc23.tar.gz

4. create user groups and users
Groupadd mysql CREATE a mysql Group
Useradd mysql-g mysql
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
First try the table and require mysql users to access it. 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 mysql users 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 empty. You must change it immediately for security purposes.
13. set to enable mysql to run automatically at each startup
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

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.

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.