LINUX Mysql5.6.19 安装

1、需要扩展安装

yum -y install make  bison gcc-c++ cmake ncurses ncurses-devel

2、下载Mysql5.6.19

wget ftp://mirror.switch.ch/mirror/mysql/Downloads/MySQL-5.6/mysql-5.6.19.tar.gz

3、解压安装

tar zxvf mysql-5.6.19.tar.gz
cd mysql-5.6.19
cmake -DCMAKE_INSTALL_PREFIX=/mysql/3306 -DMYSQL_DATADIR=/mysql/data -DSYSCONFDIR=/etc -DWITH_MYISAM_STORAGE_ENGINE=1 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_MEMORY_STORAGE_ENGINE=1 -DWITH_READLINE=1 -DMYSQL_UNIX_ADDR=/tmp/mysqld.sock -DMYSQL_TCP_PORT=3306 -DENABLED_LOCAL_INFILE=1  -DWITH_PARTITION_STORAGE_ENGINE=1 -DEXTRA_CHARSETS=all -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci

4、编译

make && make install

5、安装配置

cd /mysql/3306
chown -R mysql:mysql .
cd /opt/mysql-5.6.19
cp support-files/my-default.cnf /etc/my.cnf
cp support-files/mysql.server /etc/init.d/mysqld
chmod 755 /etc/init.d/mysqld
mkdir -p /mysql/data
chown -R mysql:mysql /mysql/data
/mysql/3306/scripts/mysql_install_db --user=mysql --basedir=/mysql/3306/ --datadir=/mysql/data/

6、启动

service mysqld start

7、测试

[root@mysql mysql-5.6.19]# /mysql/3306/bin/mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.6.19 Source distribution
 
Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
 
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
 
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
 
mysql>

8、停止MYSQL

service mysqld stop

9、以安全模式启动MYSQL

/mysql/3306/bin/mysqld_safe --skip-grant-tables & 

10、安全模式进入数据库

/mysql/3306/bin/mysql -u root -p

11、修改密码

>use mysql
>update user set password=password("新密码") where user="root";
>flush privileges;

12、退出,重启

 

posted @ 2014-08-02 16:33  @创可贴  阅读(1964)  评论(0编辑  收藏  举报