centos6.5 yum安装mysql_CentOS 6.5使用yum安装MySQL快速上手必备
CentOS 6.5使用yum安裝MySQL快速上手必備
第1步、yum安裝mysql
[root@stonex ~]#? yum -y install mysql-server
安裝結(jié)果:
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步、設(shè)置開機(jī)啟動
[root@stonex ~]#? chkconfig mysqld on
第3步、啟動MySql服務(wù)
[root@stonex ~]#? service mysqld start
第4步、設(shè)置MySQL的root用戶設(shè)置密碼
[root@stonex ~]#? mysql -u root
Welcome to the MySQL monitor.? Commands end with ; or \g.
...... 省略了一些行
mysql> select user,host,password from mysql.user;
查詢用戶的密碼,都為空,用下面的命令設(shè)置root的密碼為root
mysql> set password for root@localhost=password('root');
mysql> exit
第5步、用新密碼登陸
[root@stonex ~]#? mysql -u root -p
第6步、基本命令
show databases; //查看系統(tǒng)已存在的數(shù)據(jù)庫
use databasesname;? //選擇需要使用的數(shù)據(jù)庫
drop database databasename; //刪除選定的數(shù)據(jù)庫
exit? ? //退出數(shù)據(jù)庫的連接
create database test01;? ? //建立名為test的數(shù)據(jù)庫
show tables;? ? ? ? // 列出當(dāng)前數(shù)據(jù)庫下的表
其他基本的增刪改查使用標(biāo)準(zhǔn)SQL即可
總結(jié)
以上是生活随笔為你收集整理的centos6.5 yum安装mysql_CentOS 6.5使用yum安装MySQL快速上手必备的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 铝机箱十大品牌排行榜
- 下一篇: 网络存储“我家云”详细测评