標籤:mysql基本語句
grant all privileges on *.* to [email protected]‘192.168.200.%‘ identified by ‘linwei‘
flush privileges;
grant 許可權 on 資料庫物件.表 to 使用者@ip identified by 密碼
許可權:REPLICATION SLACE,REPLICATION CLIENT
資料庫物件:*.*(*.*說明資料庫.表名)
使用者:shenge1 那個%號是萬用字元,表示使用者relp能在192.168.200.1~192.168.200.254所在的服務登入密碼:linwei
mysql -u shenge1 -h 192.168.200.157 --password=linwei 登陸或者-p手動輸入密碼
mysql < 01.sql =>在01.sql中寫好mysql語句,可以這樣執行.
mysql -u shenge1 -h 192.168.200.157 --password=linwei < 01.sql
delete from mysql.user where User=‘shenge1‘; 刪除某個使用者
show databases;顯示所有資料庫
show tables from mysql; 顯示mysql資料庫中的所有表名
create database student;建一個student資料庫
drop database student;刪除student資料庫
create table test.student(name char,math int);在資料庫test中建立student表格
drop table test.student;刪除test資料庫中的student表格
show columns from 表名或者describe 表名 查看錶的結構
insert into test.student(name,math)values(‘xiaoming‘,87);插入資料
alter table test.student drop name;刪除name這個欄位.
alter table test.student add name(20);增加name這個欄位
update test.student set name="xiaoming" where math=78;更新某個資料的值
本文出自 “12208412” 部落格,請務必保留此出處http://12218412.blog.51cto.com/12208412/1878028
mysql基本基本語句