CentOS6中的mysql及基本用法
1、查看mysql-server包信息
[root@CentOS6 ~]#yum info mysql-server
2、安裝mysql-server包
[root@CentOS6 ~]#yum install mysql-server
注意:安裝mysql-server包的時候系統自動幫我們安裝了客戶端包mysql。
3、客戶端登陸mysql
[root@CentOS6 ~]#mysql
出現上圖所示,表示已經登陸到mysql數據庫,可以開始正常的增刪改查操作了!
4、mysql數據庫的使用
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 7
Server version: 5.1.73 Source distributionCopyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.
mysql> help? ? ?//根據系統提示輸入help或者是\h之后會顯示mysql的操作快捷鍵
mysql> show databases;? ? ?//查看當前數據庫中所有的數據庫列表
mysql> system hostname ;\!? ls? ? ?//在mysql數據庫中執行linux系統命令。前面加system或者\!?
mysql> status? ? ?//查看當前數據庫的狀態信息
mysql> use? mysql;? ? ?//進入mysql數據庫
mysql> use? mysql;? ? ?//進入mysql數據庫
mysql> show? tables;? ? ?//查看mysql數據庫的文件內容
mysql> select user,host,password? from? user;? ? ?//查看mysql數據庫中user表中的用戶,主機,密碼三項內容
本文來自投稿,不代表Linux運維部落立場,如若轉載,請注明出處:http://www.www58058.com/100427