ITeye博客

mysql

openstudy · 2012-11-14 22:09 · 数据库 · Markdown

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,解压缩到某目录下。 打开客户端工具,可以看到新建的数据库表,数据以及存储过程。(客户端的中文为什么时乱码呢)

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。