標籤:最近面試遇到了資料庫語句,發現自己在這方面幾乎忘光光,所以馬上去網上重新溫習一下。 零、使用者管理: 1、建立使用者: >CREATE USER name IDENTIFIED BY ‘ssapdrow‘; 2、更改密碼: >SET PASSWORD FOR name=PASSWORD(‘fdddfd‘); 3、許可權管理 >SHOW GRANTS FOR name;
標籤:情境:mysql無法執行select命令查詢,對於已存在的資料庫,除了mysql、information_schema資料庫,其它諸如nova、keystone、cinder等資料庫都有此現象。日誌報如下錯誤:此時執行:>create database db;>create table person (id int,name varchar(25))>use db;>select * from person;>drop database
標籤:情境:兩台資料庫運行一段時間後發現叢集掛了,一台服務正常,一台不正常。日誌如下: [ERROR] InnoDB: Attempted to open a previously opened tablespace. Previous tablespace mysql/innodb_table_stats uses space ID: 1 at filepath: ./mysql/innodb_table_stats.ibd. Cannot open tablespace testdb/dr_
標籤:mysql主從同步故障整理快速簡單的解決辦法:根據錯誤記錄檔情況,簡單快速確認故障點,然後確認是否可以跳過這個錯誤,跳過錯誤的方法是:set global sql_slave_skip_counter=1;跳過並忽略錯誤。故障整理:在master上刪除一條記錄時出現的故障。在master上刪除一條記錄後,slave上因找不到該記錄而報錯。出現這種情況的原因是主機上已將其刪除了,對此,可採取從機直接跳過的方式解決。stop slave;set global
標籤:索引類型: 1、普通索引create index index_name on test_table(column_name(length)); 2、唯一索引,可以有空值create unique index index_name on test_table(column_name(length)); 3、主鍵索引,不能有空 4、複合式索引,遵循“最左首碼”create index
標籤:mysql5.6初始密碼設定最近研究一下MySQL 5.6 版本發現安裝後,使用空密碼無法登陸 安裝的過程中有這樣的一句話:A RANDOM PASSWORD HAS BEEN SET FOR THE MySQL root USER ! You will find that password in ‘/root/.mysql_secret‘. You must change that password on your first