MySQLインストール手記

1066 ワード

      ,   root  , ubuntu 16.10       MySQL,       。
    ,         5.7.17,  。
           ,  。

インストールプロセス
sudo apt-get install libaio1
cd ~/software/
tar zxvf mysql-5.7.17-linux-glibc2.5-x86_64.tar.gz
ln -s mysql-5.7.17-linux-glibc2.5-x86_64 mysql
cd mysql
mkdir mysql-files
#        ,    root     
bin/mysqld --basedir=~/software/mysql --initialize --user=jackie
bin/mysql_ssl_rsa_setup --datadir ~/software/mysql/data

MySQLの起動
cd ~/software/mysql
bin/mysqld_safe --defaults-file=~/software/mysql/my.cnf --user=jackie

パスワードの変更
cd ~/software/mysql
#       ,           
bin/mysql -uroot -p
#     
alter user 'root'@'localhost' identified by 'mypassword';
その他の一般的なSQL
update user set authentication_string=password('mypassword') where user='root';
update user set account_locked='N' where user='root';
flush privileges;

原文を参照:http://www.jackieathome.net/archives/481.html