MYSQL的常用語句

2021-06-18 05:11:49 字數 699 閱讀 2476

mysql–u root –p;

mysql–u openacs–p;

輸入上句後回車之後輸入密碼, 初始安裝之後mysql的root沒有密碼.

grant all on acs.* to openacs identified by'openacs';

flushprivileges

grantselect,insert,update,delete,create,drop,indexon acs.* to openacs@l

ocalhost identified by 'openacs';

query ok, 0 rows affected (0.03 sec)

create database openacs;

create table ***(index1 int, index2 int);

drop table ***;

匯出資料庫指令碼mysqldump–u root –p acs> c:\acs.sql;

遠端匯出mysqldump–h192.168.30.180 –u root –p acs>c:\acs.sql;

匯出表結構mysqldump–u root –p acsconfiguration > c:\acs1.sql; 在-u前加-d則不帶表中的資料;

匯入資料庫 use acs; mysql> source c:\acs.sql;

mysql常用語句 MySQL常用語句

create table student id int primary key auto increment comment 學號 name varchar 200 comment 姓名 age int comment 年齡 comment 學生資訊 修改表注釋 alter table studen...

php mysql 常用語句 mysql常用語句

一 修改mysql使用者密碼 mysql h localhost u root p 命令列登入 update user set password password 123456 where user root 二 資料庫操作 show databases 顯示資料庫 create database ...

MySQL常用語句

and和or可以混用,and比or具有更高的優先順序,但盡量使用圓括號區分 自動過濾重複的資料owner,關鍵字distinct select distinct owner from pet 按照生日公升序排列,關鍵字order by select name,birth from pet order...