下载mysql  5.5.18  169M    

http://www.mysql.com/downloads/mysql

选择 linux Generic             用户名haogeoyes  密码在haogeoyes@163.com

解压rar包

tar xvf  Mysql-5.5.18-linux.rar  解压出

server client  test devel embedded shared.rpm 包

查询mysql数据包 rpm -qa | grep -i  mysql

========================================

安装server服务

rpm  -vih *server.rpm

安装信息

[root@haoge_OYes haoge]# rpm -vih MySQL-server-5.5.18-1.linux2.6.i386.rpm
Preparing...                ########################################### [100%]
   1:MySQL-server           ########################################### [100%]

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:

/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h haoge_OYes password 'new-password'

Alternatively you can run:
/usr/bin/mysql_secure_installation

which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.

See the manual for more instructions.

Please report any problems with the /usr/bin/mysqlbug script!

/usr/share/mysql/mysql.server   启动脚本

示例配置文件my-me.....!@#

cp  /usr/share/mysql/my-m#@¥%¥   /etc/my.cnf

rpm 自动安装成系统服务

/etc/init.d/mysql start                service mysql restart

===================================

安装mysql客户端

rpm -vih   Mysql-client.rpm

客户程序在  /usr/bin

服务程序   /usr/sbin

错误日志目录  /var/lib/mysql

更改错误日志存放位置,修改/etc/my.cnf

添加:

【mysql_safe】

err-log = /var/log/mysqld.log

mysql初始化工具

/usr/bin/mysql_install_db

=====卸载mysql======================

rpm -qa  | grep -i mysql

rpm -ev Mysql$%#@  Mysql!@#$

rpm -f  /etc/my.cnf

rpm -frvi  /var/lib/mysql

 

=====mysql的使用============================

service mysql reload

mysql -u root                     -p  $@#    -h  192.168.0.1

==增加用户=grant 权限 on 数据库.* to 用户名@登录主机 identified by "密码"

对所有数据库操作权限  haoge只准许本机登陆

grant select.insert,update,delete on * .* to haoge@localhost identified by haoge/0ye

=======数据库操作=========================

show database;

create database haoge;

use haoge;

show tables;

==========备份数据库------------

mysqldump -u root  haoge>haoge.data