MySqlÊý¾Ý¿âÓû§ÃÜÂëµÄÐÞ¸Ä
»·¾³£º
²Ù×÷ϵͳ£ºWIN2003
MySql£ºmysql Ver 12.22 Distrib 4.0.18, for Win95/Win98 (i32)
˼Ï룺
ΪÁË°²È«¼ÓÃÜÐèÒªÉèÖÃmysqlÊý¾Ý¿âÏà¹ØÓû§µÄÃÜÂ룻
MySqlÊý¾Ý¿âµÄÃÜÂ붼ÊDZ£´æÔÚmysqlÊý¾Ý¿âʵÀýµÄuser±íÖеÄpassword×Ö¶ÎÀͨ¹ýPASSWORD("")µÄº¯Êý¶ÔÃÜÂë¼ÓÃܺ󱣴æÔÚ±íÖУ»
ËùÒÔÒªÐÞ¸ÄÓû§µÄÃÜÂëÖ»ÐèÒª¸Ä±äÏàÓ¦µÄ×Ö¶ÎÄÚÈݾͿÉÒÔÁË¡£
×¢Ò⣺
ÎÒÕâÀï·¢ÏÖadminÓû§ÔÚuser±íÖеÄUser×Ö¶ÎΪ¿Õ£¬¶ø²»ÊÇÏòÆäËûÓû§ÄÇÑùÖ±½ÓÏÔʾ³öÀ´µÄ¡£
²½Ö裺
mysql µÄroot¿ÚÁîÒѸüÐÂΪ root£¬adminÃÜÂë¸ü¸ÄΪadmin
1¡¢±à¼ c:\window\my.ini
ÔÚmy.iniÅäÖöÎÌí¼ÓÈçÏÂÒ»ÐУº
skip-grant-tables
±£´æÍ˳ö±à¼¡£
2¡¢È»ºóÖØÆôMySQL·þÎñ
windows»·¾³ÖУº
net stop MySQL
net start MySQL
3¡¢ÉèÖÃеÄrootÃÜÂë
cd c:\mysql\bin
mysql -u root -p
use mysql
update user set password=PASSWORD("mysql") where user='root';
update user set password=PASSWORD("root") where user='';
(×¢£ºmysqlµÄuser±íÖÐuser=''¼´Îªadmin Óû§)
flush privileges ;
quit Í˳öMySQL
4¡¢»¹ÔÅäÖÃÎļþ²¢ÖØÆô·þÎñ
ɾ³ýmy.iniÖиղÅÌí¼ÓµÄÄÇÐÐ
net stop MySQL
net start MySQL
ÐÞ¸ÄÍê±Ï¡£
Ïà¹ØÎĵµ£º
#!/bin/bash
#ɾ³ý100¸öÊý¾Ý¿âÖеÄ1000¸ö±íµÄ¹ýÆÚÊý¾Ý
DBHOST="127.0.0.1"
DBPWD="pwd"
DBUSER="root"
MYSQLBIN="/usr/local/mysql/bin/mysql"
for((dbindex = 0;dbindex < 100;dbindex++))
do
for((tabindex = 0;tabindex < 10;tabindex++))
do
if [&n ......
1¡¢´ò¿ªÎı¾±à¼my.cnf
sudo gedit /etc/mysql/my.cnf
ÔÚ[client]
½Úµã£¬Ìí¼Ó
default-character-set=utf8 (¿Í»§¶ËȱʡÒÔutf8´æ´¢)
ÔÚ[mysqld]
½Úµã£¬Ìí¼Ó
default-character-set=utf8 (Êý¾Ý¿âȱʡÒÔutf8´æ´¢)
init_connect='SET NAMES utf8'
£¨É趨Á¬½ÓmysqlÊý¾Ý¿âʱʹÓÃutf8±àÂ룬ÒÔÈÃmysqlÊý¾Ý¿âΪutf8 ......
1¡¢Ñ¡È¡×îÊÊÓõÄ×Ö¶ÎÊôÐÔ
¡¡¡¡MySQL¿ÉÒԺܺõÄÖ§³Ö´óÊý¾ÝÁ¿µÄ´æÈ¡£¬µ«ÊÇÒ»°ã˵À´£¬Êý¾Ý¿âÖеıíԽС£¬ÔÚËüÉÏÃæÖ´ÐеIJéѯҲ¾Í»áÔ½¿ì¡£Òò´Ë£¬ÔÚ´´½¨±íµÄʱºò£¬ÎªÁË»ñµÃ¸üºÃµÄÐÔÄÜ£¬ÎÒÃÇ¿ÉÒÔ½«±íÖÐ×ֶεĿí¶ÈÉèµÃ¾¡¿ÉÄÜС¡£ÀýÈ磬ÔÚ¶¨ÒåÓÊÕþ±àÂëÕâ¸ö×Ö¶Îʱ£¬Èç¹û½«ÆäÉèÖÃΪCHAR(255),ÏÔÈ»¸øÊý¾Ý¿âÔö¼ÓÁ˲»±ØÒªµÄ¿Õ¼ä£¬ÉõÖÁÊ ......
MySql°æ±¾ÐÅÏ¢µÄ²éѯ£º
1¡¢Í¨¹ýmysql -VÃüÁî²éѯ
C:\mysql\bin>mysql -V
mysql Ver 12.22 Distrib 4.0.18, for Win95/Win98 (i32)
2¡¢Í¨¹ýmysqlģʽϵÄstatusÃüÁî²é¿´×´Ì¬
mysql> status
--------------
mysql Ver 12.22 Distrib 4.0.18, for Win95/Win98 (i32)
Connection id: &nbs ......