如何修改MYSQL的默认编码
MySQL的默认编码是Latin1,不支持中文.要让默认编码变为utf8。可进行如下配置:
SET GLOBAL character_set_client = utf8;
SET GLOBAL character_set_connection = utf8;
SET GLOBAL character_set_database = utf8;
SET GLOBAL character_set_results = utf8;
SET GLOBAL character_set_server = utf8;
SET GLOBAL character_set_system = utf8;
重启Mysql:
检查结果:
show variables like "char%";
相关文档:
本文链接http://www.chysoft.net/files/article_234.htm 更多资讯请进入www.chysoft.net
mysql的数据储存目录在mysql的配置文件my.ini文件设置,格式如下:
# Uncomment the following rows if you move the MySQL distribution to another
# location
basedir = d:/cyoa/mysql_cy/
datadir = d:/cyoa/mysq ......
conn.php
<?php
/*
* Created on 2010-1-6
* Author:CHAUVET
* Function:连接字符串
*/
$conn=@mysql_connect("localhost","root","")or die("连接数据库出错!");
mysql_select_db("newdb",$conn);
mysql_query("set names 'gb2312'");
function ReplaceSom ......
原文转自:http://hi.baidu.com/jackli00/blog/item/21b2e242025bfa1473f05d24.html
Mysql开启日志
2008-11-18 11:23
是否启用了日志
mysql>show variables like 'log_bin';
怎样知道当前的日志
mysql> show master status;
看二进制日志文件用mysqlbinlog
shell>mysqlbinlog mail-bin.000001(要写绝对问题 ......
整理tuscany.org.cn的服务器,发现3年前写的脚本还在跑着 :)
脚本如下:
#==========================================================
#!/bin/bash
current_date=`date +%Y-%m-%d:%H:%M:%S`
/usr/local/mysql/bin/mysqldump -prootpass dbname1 > ./DB_DIR/dbname1_"$current_date"_dump_file.sql
......
问题:远程连接服务器的数据库
$ mysql -hserverip -uuser -ppassword
ERROR 1045 (28000): Access denied for user 'user'@'localhost'
(using password: YES)
原因:mysql.user表中没有设置远程连接
$ mysql -uroot -ppassword #用root用户在server上登录
mysql> select host, user, password from mysql ......