<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                [TOC] /etc/init.d/mysql start (啟動數據庫) ### 數據庫用戶管理 ~~~ mysql -uroot -p (回車輸入密碼: 連接本地數據庫) 另外一種全面的寫法: mysql -h主機名 -u用戶名 -p密碼( mysql -hlocalhost -uroot -proot) mysqladmin -uroot -proot password root123 (修改數據庫密碼root為root123) ~~~ 添加用戶: > grant select,insert,update,delete on *.* to username@"%" identified by "password" (*.*表示所有的數據庫,"%"表示任何主機,密碼可以為空by "") > (grant select on uwebcms.* to test@localhost identified by "test") > 表示添加了一個test用戶,密碼為test,權限:只能在localhost上登錄,并且只有uwebcms數據庫的查詢操作 > 刪除用戶: > drop user 用戶名@"%" > drop user 用戶名@localhost > 查看所有數據庫用戶: > select distinct concat('user: ''',user,'''@''',host,''';') as query from mysql.user; `exit (退出數據庫)` 進入數據庫后的每一步操作都要加上分號(;) ### 數據庫操作 ~~~ { show databases; (顯示全部的數據庫) create database name; (創建某個數據庫:create database test;) drop database name; (刪除數據庫) } ~~~ ### 數據表操作 ~~~ { use mysql; (使用某個數據庫:use test;) create table name (`id` int(11), `name` varchar(30)); (創建表) create table category( `id` int(11) auto_increment not null primary key,`pid` int(11) not null,`name` varchar(30)); show tables; (顯示當前數據庫的所有數據表) describe table; (顯示某個表的結構:describe user;) drop table name; (刪除數據表name) } ~~~ ### 數據增刪查改 ~~~ { insert into table values(1, 'name1'); (插入數據) insert into table values(1, 'name1'), (2, 'name2'); (插入多條數據) select * from table; (查詢表中的所有數據:select * from user) delete from table where id=1; (刪除id=1的數據) delete from table; (刪除表中所有數據) update table set name='nickname',age=5 where id=4; (修改表數據) } ~~~ ### 操作數據庫結構 ~~~ { alter table name add column field type; (添加新的字段,其中column可以不寫) alter table admin add column (age int(10),pass char(30)); (添加多個字段) alter table name change old_field new_field consolution; (修改字段) alter table admin change `pass` `passwd` char(30) comment '密碼'; alter table name drop column field; (刪除字段,其中column可以不寫) } ~~~
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看