杨子刚的博客


mysql

2014-06-23

创建数据库 create database doctor default character set utf8 collate utf8_general_ci;

导出表结构 mysqldump --opt -d doctor -u root -p > xxx.sql

赋予权限用户对doctor数据库的权限 grant all privileges on doctor.* to username@'localhost' identified by 'password';

tomcat7 webapps位置 /var/lib/tomcat7/webapps/

mysql修改字段 alter table user change password password varchar(256)

删除某个字段 alter table patient delete salt

添加字段 alter table user add column slat varchar(32)

mac os x 安装mysql

#启动mysql
sudo port load mysql55-server
#停止mysql
sudo port unload mysql55-server

#无法连接问题的解决
#com.mysql.jdbc.Driver (Communications link failure  The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.) 
#编辑文件 /opt/local/etc/mysql55/macports-default.cnf
# MacPorts default options
[mysqld]
# skip-networking so multple mysql server ports can be loaded
# without each competing for port 3306.
# comment skip-networking
#skip-networking
bind-address="127.0.0.1"
wait_timeout = 60
interactive_timeout=60
connect_timeout=60

Solving a “communications link failure” with JDBC and MySQL