MySQLInstall in Linux

Source: Internet
Author: User
Tags root access
1. Mysql installation package from www.mysql.com is blooming 2. Copy the mysql compressed package to usrlocal directory # cpmysql-standard-5.0.15-linux

1. Mysql installation package from http://www.mysql.com download bloom 2. Copy mysql compressed package to/usr/local/directory # cp mysql-standard-5.0.15-linux

1. The downloaded Mysql installation package is blooming

2. Copy the mysql compressed package to the/usr/local/directory.

# Cp mysql-standard-5.0.15-linux-gnu-i686-glibc23.tar.gz/usr/local

3. decompress the package to/usr/ocal/and change it to mysql. To save space, delete the mysql installation package.

# Tar xzvf mysql-standard-5.0.15-linux-gnu-i686-glibc23.tar.gz

# Music mysql-standard-5.0.15-linux-gnu-i686-glibc23 mysql

# Rm mysql-standard-5.0.15-linux-gnu-i686-glibc23

4. Create a mysql group, create a mysql user, and add the user to the mysql group.

# Groupadd mysql

# Useradd mysql-g mysql

5. Overwrite/etc/my. cnf

# Cp/usr/local/mysql/support-files/my-medium.cnf/etc/my. cnf

6. Go to the mysql directory and make the table a preliminary test and use the mysql user to access the table. After the table is initialized, set the access permissions for mysql and root users.

# Cd/usr/local/mysql

#./Scripts/mysql_install_db -- user = mysql

7. Set root access to/usr/local/mysql

# Chown-R root.

8. set the mysql user to access/usr/local/mysql/data, which stores mysql database files. this directory is in/etc/my. cnf is configured, which is generated when mysql_install_db

# Chown-R mysql data

9. Set mysql users to access all files in/usr/local/mysql/data/mysql.

# Chown-R mysql data /.

10. Set the mysql group to access/usr/local/mysql.

# Chgrp-R mysql.

11. Run mysql. If there is no problem, a prompt like this should appear:

[1] 42264

Starting mysqld daemon with databases from/usr/local/mysql/var

#/Usr/local/mysql/bin/mysqld_safe -- user = mysql &

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

13. copy a script in the compiling directory 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

14. Start the mysqld service hug

# Service mysqld start

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.