mysql常用操作

2022-03-04 18:13:31 字數 540 閱讀 9695

1. 給資料庫新增登入使用者和許可權

# 建立使用者

create

user

'ecsoft

' identified by

'ecsoft';

# grant all privileges on 庫名.表名 to '使用者名稱'@'ip位址' identified by '密碼' with grant option;

grant

allprivileges

on ecsoft.*

to ecsoft@"localhost" identified by

'ecsoft';

//後面在使用過程中,發現指定單個資料庫許可權的時候,經常連線不上。後面改成所有的資料庫連線就可以。

grant all privileges on *.* to ecsoft@"localhost" identified by 'ecsoft';

# 提交

flush

privileges;

my sql常用操作

1.grant allprivilegeson tomonty localhost identified by something with grant option monty 可以從任何地方連線伺服器的乙個完全的超級使用者,但是必須使用乙個口令 something 做這個。注意,我們必須對 mo...

mysql 常用操作

1 修改表名在mysql中修改表名的sql語句在使用mysql時,經常遇到表名不符合規範或標準,但是表裡已經有大量的資料了,如何保留資料,只更改表名呢?alter table table name rename to new table name 例如alter table admin user r...

mysql常用操作

mysql常用操作 修改root密碼 用root 進入mysql後 mysql set password password 你的密碼 mysql flush privileges 檢視表結構 show create table 表名 清空表且令自增字段從1開始 truncate table 表名 檢...