修改数据库的字符集 mysql>use mydb mysql>alter database mydb character set utf8;创建数据库指定数据库的字符集 mysql>create database mydb character set utf8; 查看database的字符集! show variables like 'collation_%'; show variables like 'character_set_%'; 一.系统操作 1.…
更新表数据: update table_name set xxx=xxx where condition; 增加字段: alter table table_name add field type other; e.g: ) '; 删除字段: ALTER TABLE table_name DROP field_name; 增加删除索引: # 增加 alter table 表名 add index 索引名 (字段名1[,字段名2 …]); # 删除 alter table 表名 drop index…
mysql增删改查相关操作 以前用mysql用的少,对于数据库相关的操作不熟悉,现在开始要接触数据库了,记录一下相关的基础操作吧. 1.数据库的授权操作 # mysql -u root -p Enter password: mysql> grant all privileges on *.* to root@'%' identified by '<password>' with grant option; ## 表示为root用户添加所有数据库所有权限,并可以给其他人授权. mysql&…