1、登录数据库
mysql -h localhost -uroot –p
2、导出数据库
mysqldump -uroot -p db > db.sql
3、导入数据库
mysql -uroot -p db < db.sql
4、开启远程登录,局域网访问
grant all privileges on *.* to 'root'@'%' indentified by '你的密码' with grant option;
flush privileges;
CREATE USER 'test'@'localhost' IDENTIFIED BY 'password';grant all privileges on *.* to test@'localhost' identified by 'test';
CREATE SCHEMA testdb DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
GRANT ALL ON testdb.* TO 'test'@'localhost';
8、增删改查
UPDATE 表名 SET 字段名1='a',字段名2='b' WHERE 字段名3='c';insert into 表 values('字段');