Install mysql,

Source: Internet
Author: User
Tags mysql commands

Install mysql,

Installation environment: The system is centos6.5

1. Download

: Http://dev.mysql.com/downloads/mysql/5.6.html#downloads

Download version: I have selected 5.6.33, general edition, and 64-bit linux.

You can also directly copy the 64-bit, through the command download: wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.33-linux-glibc2.5-x86_64.tar.gz

2. Decompress

# Decompress tar -zxvf mysql-5.6.33-linux-glibc2.5-x86_64. tar .gz # Copy and decompress the mysql directory cp -r mysql-5.6.33-linux-glibc2.5-x86_64 /usr/local/mysql3. Add User Groups and users # Add a user group groupadd mysql # Add a user mysql to the user group mysql useradd -g mysql mysql

4. Installation

cd /usr/local/mysql/ <br> mkdir . /data/mysql chown -R mysql:mysql ./ . /scripts/mysql_install_db --user=mysql --datadir= /usr/local/mysql/data/mysql cp support-files /mysql .server /etc/init .d /mysqld chmod 755 /etc/init .d /mysqld cp support-files /my-default .cnf /etc/my .cnf  # Modify the Startup Script vi /etc/init .d /mysqld  # Modify items: basedir= /usr/local/mysql/ datadir= /usr/local/mysql/data/mysql  # Start the service service mysqld start  # Test connection . /mysql/bin/mysql -uroot  # Add environment variables and edit/etc/profile so that mysql commands can be used anywhere. export PATH=$PATH: /usr/local/mysql//bin <br> source /etc/profile # Start mysql service mysqld start # Disabling mysql service mysqld stop # View the running status service mysqld status

5. Error

5.1 error 1130 is reported when sqlyog is connected because the remote connection user permission is not granted.

Solution 1: Change the 'host' entry in the 'mysql' database 'user' table and change it from 'localhost' to '% '.

use mysql;select 'host' from user where user='root'; update user set host = '%' where user ='root';flush privileges; 

Solution 2: direct authorization

Grant all privileges on *. * TO 'root' @ '%' identified by 'youpassword' with grant option;

5.2 installation errors

-Bash:./scripts/mysql_install_db:/usr/bin/perl: bad interpreter: No file or directory
Solution: yum-y install perl-devel

Installing MySQL system tables.../bin/mysqld: error while loading shared libraries: libaio. so.1: cannot open shared object file: No such file or directory
Solution: yum-y install libaio-devel

6. Others

6.1 configure Environment Variables

Vi +/etc/profile

Export PATH =...:/usr/local/mysql/bin

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.