mysql数据库安装
广告投放★自助友情CMS落伍广告联盟晒乐广告联盟脉动广告联盟品味广告联盟
广告位可自定样式联系QQ:38355018个文字广告月20元广告联系QQ:3835501广告位可自定样式
8个文字广告月20元黄金广告位每月20元广告位可自定样式联系QQ:3835501广告位可自定样式
左旋肉碱、全国包邮
买二送一、无效退款

文章浏览→编程相关Mysql→mysql数据库安装

mysql数据库安装
mysql数据库安装

tar xzvf mysql-5.0.45.tar.gz


cd /home/mysql-5.0.45


./configure  --prefix=/usr/local/mysql5.0.45--with-charset=utf8 --with-extra-charsets=all--enable-thread-safe-client


make


make install


cp/usr/local/mysql5.0.45/share/mysql/my-small.cnf /etc/my.cnf `执行后选 Y 覆盖

修改/etc/my.cnf

在[mysqld] 和 [client]段都加入如下指令即可:


default-character-set=utf8


/usr/local/mysql5.0.45/bin/mysql_install_db

/usr/local/mysql5.0.45/bin/mysqld_safe --user=root& 启动mysql服务/usr/local/mysql5.0.45/bin/mysql -u root mysql -p

mysql -u root -p `进入mysql操作 密码为空直接回车确认

use mysql;  update user setPassword=PASSWORD('2592058') where User='root';`XXXXX为你要设置mysql管理员的密码

insert into mysql.user (Host, User,  Password, Select_priv,  Insert_priv, Update_priv,  Delete_priv, Create_priv,  Drop_priv, Reload_priv,  Shutdown_priv, Process_priv,  File_priv, Grant_priv,  References_priv, Index_priv,  Alter_priv, Show_db_priv,  Super_priv, Create_tmp_table_priv, Lock_tables_priv,  Execute_priv, Repl_slave_priv, Repl_client_priv, Create_view_priv, Show_view_priv, Create_routine_priv, Alter_routine_priv, Create_user_priv,  ssl_type, ssl_cipher,  x509_issuer, x509_subject,  max_questions, max_updates,  max_connections, max_user_connections) value ('192.168.%.%', 'tlbb','*C6F4E3C4123F5707129F96C63E488D268C89C1CA','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0);

insert into mysql.user (Host, User,  Password, Select_priv,  Insert_priv, Update_priv,  Delete_priv, Create_priv,  Drop_priv, Reload_priv,  Shutdown_priv, Process_priv,  File_priv, Grant_priv,  References_priv, Index_priv,  Alter_priv, Show_db_priv,  Super_priv, Create_tmp_table_priv, Lock_tables_priv,  Execute_priv, Repl_slave_priv, Repl_client_priv, Create_view_priv, Show_view_priv, Create_routine_priv, Alter_routine_priv, Create_user_priv,  ssl_type, ssl_cipher,  x509_issuer, x509_subject,  max_questions, max_updates,  max_connections, max_user_connections) value ('192.168.%.%', 'tlbbtools','*70851F21ECE641B52D5B9946950566EB08C935DA','Y','Y','Y','Y','N','Y','N','N','N','N','N','Y','Y','N','N','N','Y','N','Y','N','N','Y','Y','N','N','N','','','','',0,0,0,0);

flush privileges;

create database tlbbdb;

create database tlbbdb_stat;

insert into mysql.db ( Host, Db, User, Select_priv, Insert_priv,Update_priv, Delete_priv, Create_priv, Drop_priv, Grant_priv,References_priv, Index_priv, Alter_priv, Create_tmp_table_priv,Lock_tables_priv, Create_view_priv, Show_view_priv,Create_routine_priv, Alter_routine_priv, Execute_priv) value('172.16.%.%', 'tlbbdb','tlbb', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y','Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y');

insert into mysql.db ( Host, Db, User, Select_priv, Insert_priv,Update_priv, Delete_priv, Create_priv, Drop_priv, Grant_priv,References_priv, Index_priv, Alter_priv, Create_tmp_table_priv,Lock_tables_priv, Create_view_priv, Show_view_priv,Create_routine_priv, Alter_routine_priv, Execute_priv) value('172.16.%.%', 'tlbbdb','tlbbtools', 'Y', 'Y', 'Y', 'Y', 'N', 'Y','N', 'Y', 'Y', 'N', 'Y', 'N', 'Y', 'Y', 'N', 'N', 'Y');

insert into mysql.db ( Host, Db, User, Select_priv, Insert_priv,Update_priv, Delete_priv, Create_priv, Drop_priv, Grant_priv,References_priv, Index_priv, Alter_priv, Create_tmp_table_priv,Lock_tables_priv, Create_view_priv, Show_view_priv,Create_routine_priv, Alter_routine_priv, Execute_priv) value('172.16.%.%', 'tlbbdb_stat','tlbb', 'Y', 'N', 'N', 'N', 'N', 'N','N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N');

exit `退出mysql操作

导入数据库:

cd /home

mysql -uroot mysql -p2592058 tlbbdb <DBInit_0_9_0020_mysql.sql  ` XXXXX为你的mysqlroot密码

mysql -uroot -p2592058 tlbbdb_stat <tlbbdb_stat.sql  ` XXXXX为你的mysql root密码

所属分类:编程相关Mysql    作者:新浪博客    时间:2010-11-20 0:00:00

文章导航