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/mysql
3. 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