国产欧美日韩第一页|日本一二三不卡视频|在线精品小视频,亚洲第一免费播放区,metcn人体亚洲一区,亚洲精品午夜视频

mysql數(shù)據(jù)庫常用命令

2016-05-17 13:44:45 1156

1.開啟和關(guān)閉

net stop mysql  #停止mysql

net start mysql  #開啟mysql

2.創(chuàng)建表,:

create table myclass

3.刪除

drop table myclass;  #刪除表

delete from myclass; #清空表

drop myclass  #刪除表

4.導(dǎo)入導(dǎo)出數(shù)據(jù)庫

導(dǎo)出數(shù)據(jù):

mysqldump --opt test > d:db_name.sql   #備份數(shù)據(jù)庫

mysql -udb_user -pdb_password db_name < d:db_name.sql   #還原數(shù)據(jù)庫

5.修復(fù)表

repair table table_name;   #修復(fù)表

6.進(jìn)入mysql服務(wù)

mysql -uuser -ppassword


7.相關(guān)的基本查詢

show databases;  #查看所有數(shù)據(jù)庫

use db_name;    #選擇某個數(shù)據(jù)庫

show talbes;      #查看選擇后的某數(shù)據(jù)庫所有表

8.創(chuàng)建用戶名create user name;

給用戶賦登錄密碼update mysql.user set password=password('password1') where user="name"; 也可以在root用戶下用此命令修改其他數(shù)據(jù)庫密碼。

給用戶授予所有的權(quán)限grant all privileges on *.* to name@"%" Identified by "password1" with grant option;

blob.png




提交成功!非常感謝您的反饋,我們會繼續(xù)努力做到更好!

這條文檔是否有幫助解決問題?

非常抱歉未能幫助到您。為了給您提供更好的服務(wù),我們很需要您進(jìn)一步的反饋信息:

在文檔使用中是否遇到以下問題: