mysql

jdbc:mysql://localhost/xplanner?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8

1.开远程方法:
mysql -uroot
grant all on *.* to 'root'@'%' identified by 'password';//开远程
grant all on *.* to 'root'@'localhost' identified by 'password';//开本地
2.添加新帐户
grant all on *.* to 'rongrong'@'%' identified by 'password';
grant all on *.* to 'rongrong'@'localhost' identified by 'password';
3.执行脚本文件命令的两种方法:
mysql -u root -h 192.9.100.50 -p test<d:\mysql5\1.sql
source d:\mysql5\1.sql
4.显示存储过程
SHOW CREATE PROCEDURE test.simpleproc\G
test是数据库,simpleproc存储过程名称
如果当前数据库是test,则不用加test.
5.中文字段的排序问题:select name, id from animals order by binary name;
6.随机排序:select * from t_student order by rand()

show character set;//显示所有的字符集


今天把我机子上的mysql5.0.9换成了mysql5.0.12
1.删除mysql5.0.9(我的是解压缩版的,不用卸载,直接删除目录)。
2.http://dev.mysql.com/下载mysql-noinstall-5.0.12-beta-win32.zip,解压缩到某目录下。
3.启动mysql服务器,mysqld --console
4.客户端登录mysql,mysql -uroot
5.开远程grant all on *.* to 'root'@'%' identified by 'password';
6.退出quit,重新登录mysql -h192.9.100.50 -uroot -p
7.创建数据库create database dbk;
8.退出quit,执行脚本文件命令
创建表mysql -h192.9.100.50 -uroot -p dbk<Crt_table.sql
加载表数据mysql -hyww -uroot -p96311311 dbk<load_data.sql
创建存储过程mysql -h192.9.100.50 -uroot -p dbk<proc.sql
9.下载客户端查询工具mysql-query-browser-1.1.14-win-noinstall.zip,解压缩到某目录下。
打开客户端工具,可以看到新建的数据库表,数据以及存储过程。(客户端的中文为什么时乱码呢)
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值