yum -y install mariadb-server mariadb
mysql> use mysql;
mysql> update user set password=PASSWORD("") where User='root';
mysql> flush privileges;
mysql> create database hululuu CHARACTER SET utf8 COLLATE utf8_unicode_ci;
sequel -m db mysql2://root@localhost/hululuu
mysqldump --no-create-info -uroot ecms table_name > sql/table_name.sql
mysql -uroot ecms < sql/table_name.sql
Table 'performance_schema.session_variables' doesn't exist
mysql> set @@global.show_compatibility_56=ON;
sequel pro
mysql命令行里查询显示中文
show variables like 'character%';
set character_set_results=gb2312;
#或者
set names gbk;
查表数量
SELECT COUNT(*) FROM information_schema.tables WHERE table_schema='hululuu'
gem i mysql2
windows上
#把c:\gem_build\mysql_5_5\bin;c:\gem_build\mysql_5_5\lib;加进PATH
gem i mysql2 -- --with-mysql-dir=E:/mysql-connector-c-6.1.3-win32
创建用户
create database db0 character set utf8;
create user 'q'@'localhost' identified by 'password';
grant all privileges on q.* to 'q'@'localhost';
备份
mysqldump --single-transaction -h 192.168.2.4 -u username -p app1_production > "C:\app1_production.sql"
还原
mysql -h 192.168.2.4 -u username -p app1_production < app1_production.sql