簡單安裝Mysql(linux centos)

之前寫了幾篇mysql多實例或主備安裝文章,但由於實驗需要,反而要一個快速簡單部署的mysql,so mark如下:

--------------------

rm /appl/mysql/data/dbdata
scripts/mysql_install_db --user=root --basedir=/appl/mysql --datadir=/appl/mysql/data/dbdata

bin/mysqld_safe --basedir=/appl/mysql --user=root &
mysql -uroot

show databases;
GRANT ALL PRIVILEGES ON *.* TO root@localhost IDENTIFIED BY "root";
GRANT ALL PRIVILEGES ON *.* TO root@centos1 IDENTIFIED BY "root";
FLUSH PRIVILEGES;
use mysql;
show tables;
select host,user,password from user;
exit

mysql -uroot -proot (或mysql -hcentos1 -uroot -proot)
use test;
create table bigdata (id int, name char(10));
insert into bigdata values(1,'a');
commit;
select * from bigdata;
exit

---------
/appl/mysql/my.cnf

[mysqld]
server-id = 1
port     = 3306
socket   = /tmp/mysql.sock
datadir  = /appl/mysql/data/dbdata
character_set_server=utf8
# skip-grant-tables


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