mysql安裝

weget  http://cdn.mysql.com/Downloads/MySQL-5.5/mysql-5.5.34-linux2.6-x86_64.tar.gz


shell> groupadd mysql

shell> useradd -r -g mysql mysql

shell> cd /usr/local

shell> tar zxvf /path/to/mysql-VERSION-OS.tar.gz

shell> ln -s full-path-to-mysql-VERSION-OS mysql

shell> cd mysql

shell> chown -R mysql .

shell> chgrp -R mysql .

shell> scripts/mysql_install_db --user=mysql

shell> chown -R root .

shell> chown -R mysql data

# Next command is optional

shell> cp support-files/my-medium.cnf /etc/my.cnf

shell> bin/mysqld_safe --user=mysql &

# Next command is optional

shell> cp support-files/mysql.server /etc/init.d/mysql.server



修改密碼

./bin/mysqladmin -u root password 'new-password'

./bin/mysqladmin -u root -h localhost.localdomain password 'new-password'



運行

Alternatively you can run:

./bin/mysql_secure_installation



You can start the MySQL daemon with:

cd . ; ./bin/mysqld_safe &


You can test the MySQL daemon with mysql-test-run.pl

cd ./mysql-test ; perl mysql-test-run.pl




mysql -u mysql -p 


關閉數據庫

./bin/mysqladmin -uroot -p shutdown



show databases;

use test




卸載

ps -A |grep mysql

rpm -qa |grep mysql

kill 9 123

rpm -qa --nodeps | grep -i mysql 


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章