mysql基本基本語句

來源:互聯網
上載者:User

標籤: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基本基本語句

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.