mysql 常用命令

來源:互聯網
上載者:User

標籤:like   語句   格式   bsp   輸入   database   常用   提示   分享   

顯示庫設定的值 show variables

顯示特定的值

show variables like ‘%char %‘

一般如果 表不能插入中文 可以看看這 裡的庫的編碼方式

登陸mysql 

mysql -uroot -p

提示輸入密碼

 

 登陸成功後 顯示庫清單

show databases;

用哪個庫

use 庫名 如use foo 

顯示用庫下面所有的表

show tablse;

顯示表的元素

desc 表名 如 desc user;

顯示表的建表語句

show create table 表名 如 show create table user;

 

 設定表的編碼格式

alter table 表名 convert to character set utf8; 如 alter table user convert to character set utf8;

上下鍵 可以查看最近輸入的命令 CTRL + C可以退出當前命令

 

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.