易截截图软件、单文件、免安装、纯绿色、仅160KB

mysql字符集查看以及修改

转自:http://blog.chinaunix.net/u2/85344/showart_2042280.html
Liunx下修改MySQL字符集:
1.查找MySQL的cnf文件的位置
find / -iname '*.cnf' -print

/usr/share/mysql/my-innodb-heavy-4G.cnf
/usr/share/mysql/my-large.cnf
/usr/share/mysql/my-small.cnf
/usr/share/mysql/my-medium.cnf
/usr/share/mysql/my-huge.cnf
/usr/share/texmf/web2c/texmf.cnf
/usr/share/texmf/web2c/mktex.cnf
/usr/share/texmf/web2c/fmtutil.cnf
/usr/share/texmf/tex/xmltex/xmltexfmtutil.cnf
/usr/share/texmf/tex/jadetex/jadefmtutil.cnf
/usr/share/doc/MySQL-server-community-5.1.22/my-innodb-heavy-4G.cnf
/usr/share/doc/MySQL-server-community-5.1.22/my-large.cnf
/usr/share/doc/MySQL-server-community-5.1.22/my-small.cnf
/usr/share/doc/MySQL-server-community-5.1.22/my-medium.cnf
/usr/share/doc/MySQL-server-community-5.1.22/my-huge.cnf
2. 拷贝 small.cnf、my-medium.cnf、my-huge.cnf、my-innodb-heavy-4G.cnf其中的一个到/etc下,命名为my.cnf
cp /usr/share/mysql/my-medium.cnf /etc/my.cnf
3. 修改my.cnf
vi /etc/my.cnf
在[client]下添加
default-character-set=utf8
在[mysqld]下添加
default-character-set=utf8
4.重新启动MySQL
[root@bogon ~]# /etc/rc.d/init.d/mysql restart
Shutting down MySQL                                        [ 确定 ]
Starting MySQL.                                            [ 确定 ]
[root@bogon ~]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.1.22-rc-community-log MySQL Community Edition (GPL)
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
5.查看字符集设置
mysq


相关文档:

MySQL字符集的设置

【前提】
winxpsp3
mysql5.1
【步骤】
1.进入MySQL Command Line Client;
2.命令:
mysql> show variables like 'character%';
+--------------------------+---------------------------------------------------------+
| Variable_name            | ......

mysql密码忘记的修改方法

1、在linux下:
     查看mysql 是否运行:ps -ef | grep myslq
     如果 MySQL 正在运行,首先杀之: kill mysql的进程号。
  启动 MySQL :/usr/bin/safe_mysqld --skip-grant-tables &
  就可以不需要密码就进入 MySQL 了。
  然后就是
  >use mysql
   ......

MySQL数据库的基本操作命令

一、mysql服务操作
1、net start mysql //启动mysql服务
2、net stop mysql //停止mysql服务 
3、mysql -h主机地址 -u用户名 -p用户密码 //进入mysql数据库
4、quit //退出mysql操作
5、mysqladmin -u用户名 -p旧密码 password 新密码 //更改密码
6、grant select on 数据库.* to 用户名@登录主机 identifie ......

mysql connect by c++

#include <stdio.h>
#include <windows.h>
#include <mysql.h>
#define host "localhost"
#define username "root"
#define password "123"
#define database "oa"
MYSQL *conn;
int main()
{
MYSQL_RES *res_set;
MYSQL_ROW row;
unsigned int i,ret;
FILE *fp;
MYSQL_FIELD *field; ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号