MySQL相关
[my.cnf]
[mysqld]
character-set-server = utf8
init_connect = 'SET NAMES utf8'
bind-address = 具体IP列表或注释掉此条
在Ubuntu下
sudo apt-get install mysql-server
sudo service mysql start|restart|stop
如果无法启动,重新修改my.cnf
[sql 脚本]
drop database if exists mydb;
create database mydb character set 'utf8' collate 'utf8_general_ci';
revoke all on mydb.* from 'myname'@'localhost';
drop user 'myname'@'localhost';
create user 'myname'@'localhost' identified by 'mypasswd';
grant select, insert, update, delete on mydb.* to 'myname'@'localhost';
grant all on mydb.* to 'another'@'%'
use mydb;
drop table if exists t_mytable;
create table t_mytable (
n_key bigint auto_increment primary key,
s_value varchar(32) not null
) engine=innodb default charset=utf8;
alert table t_mytable add constraint mytable_pks primary key(.., .., ...);
浙公网安备 33010602011771号