插入MYSQL中文乱码
1.建表过程如下
create database test default character set utf8 collate utf8_general_ci
use test;
create table devicedata
(
ID int auto_increment PRIMARY key ,
TimeStamp datetime,
Device_Name varchar(100),
Tag_Name varchar(100),
Value varchar(50)
)
2.找到MYSQL的配置文件做如下修改
[client]
port=3306
[mysql]
default-character-set=gbk
[mysqld]
default-character-set=gbk
重启MYSQL服务
CMD net stop mysql
net start mysql
相关文档:
这几天Linux服务器很慢,很着急找不到解决办法!后百度相关字眼,查找到是MySQL的问题,
如下为解决方案
:
连接MySQL速度慢的解决方法.
PHP远程连接MYSQL速度慢,有时远程连接到MYSQL用时4-20秒不等,本地连接MYSQL正常,出现这种问题的主要原因是,默认安装的
MYSQL开启了DNS的反向解析,在MY.CNF(UNIX或LINUX系统下)或MY.INI ......
1、编辑MySQL配置文件:
windows环境中:%MySQL_installdir%\my.ini //一般在MySQL安装目录下有my.ini即MySQL的配置文件。
linux环境中:/etc/my.cnf
在[MySQLd]配置段添加如下一行:
skip-grant-tables
保存退出编辑。
2、然后重启MySQL服务
windows环境中:
net stop MySQL
net start MySQL
linux环境中:
/e ......
先用root登陆mysql -u root -p
mysql>show databases;
mysql>use mysql;
update user set password=password('你想设置的密码')
where user='root'; ......
E:\databases\MySQL\MySQL Server 5.1\bin>mysqldump --help
mysqldump Ver 10.13 Distrib 5.1.30, for Win32 (ia32)
By Igor Romanenko, Monty, Jani & Sinisa
This software comes with ABSOLUTELY NO WARRANTY. This is free softwa
and you are welcome to modify and redistribute it under the GPL ......
(1)INFORMATION_SCHEMA
select (sum(data_length) + sum(index_length))/(1024*1024) from INFORMATION_SCHEMA.`TABLES` where table_schema = 'your_table_schema' and table_name like 'your_table_name';
(2)show table status like '';
try {
Class.forName("com.mysql.jdbc.Driver");
......