標籤:option mysql kconfig moni x86_64 nbsp select databases use
第1步、yum安裝mysql
[[email protected] ~]# yum -y install mysql-server
安裝結果:
Installed:
mysql-server.x86_64 0:5.1.73-3.el6_5
Dependency Installed:
mysql.x86_64 0:5.1.73-3.el6_5 perl-DBD-MySQL.x86_64 0:4.013-3.el6 perl-DBI.x86_64 0:1.609-4.el6
第2步、設定開機啟動
[[email protected] ~]# chkconfig mysqld on
第3步、啟動MySql服務
[[email protected] ~]# service mysqld start
第4步、設定MySQL的root使用者佈建密碼
[[email protected] ~]# mysql -u root
Welcome to the MySQL monitor. Commands end with ; or \g.
...... 省略了一些行
mysql> select user,host,password from mysql.user;
查詢使用者的密碼,都為空白,用下面的命令設定root的密碼為root
mysql> set password for [email protected]=password(‘root‘);
mysql> exit
第5步、用新密碼登陸
[[email protected] ~]# mysql -u root -p
第6步、基本命令
show databases; //查看系統已存在的資料庫
use databasesname; //選擇需要使用的資料庫
drop database databasename; //刪除選定的資料庫
exit //退出資料庫的串連
create database test01; //建立名為test的資料庫
show tables; // 列出當前資料庫下的表
其他基本的增刪改查使用標準SQL即可
第7步、開放遠程登入許可權GRANT ALL PRIVILEGES ON *.* TO ‘root‘@‘%‘ IDENTIFIED BY ‘root‘ WITH GRANT OPTION;
FLUSH PRIVILEGES;
Centos6.5使用yum安裝mysql——快速上手必備(轉)