centos二进制方式安装mysql5.5

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

你可能感兴趣的:(数据库)