mysql 安装使用

使用YUM安装#!/bin/bash

#install client
yum install mysql

#install server
yum install mysql-server
yum install mysql-devel


service mysqld start
#/etc/init.d/mysqld start
#service mysqld stop

#add run-start
chkconfig --add mysqld
chkconfig --list  | grep mysql

mysqladmin -u root password 123456
#mysql -uroot -p

#grant all on *.* to mysql@"%" identified by '1';
#grant all privileges on *.* to mysql@192.168.1.3 identified by '1';
#flush privileges;
#
show create table charge;

 source ~/normal_moba_account.sql

 use moba_db_74;
INSERT INTO `dbversion` VALUES (8,0);
 SELECT * FROM account_main WHERE accountnick LIKE '%谭%'; (在编辑器编辑好,拷贝到mysql的执行console中执行)
 drop database moba_affair_74;  
%              匹配所有主机
localhost    localhost不会被解析成IP地址,直接通过UNIXsocket连接
127.0.0.1      会通过TCP/IP协议连接,并且只能在本机访问;
::1                 ::1就是兼容支持ipv6的,表示同ipv4的127.0.0.1
# mysqladmin -u root -p shutdown
# chkconfig mysqld on
# chkconfig mysqld off
# chkconfig --list mysqld
# service mysqld start

  Access denied for user 'weiphp'@'localhost' ,这个错误,不适用127.0.0.1进行连接,使用网卡地址连接

posted @ 2015-04-24 16:09  戈壁的石头  阅读(195)  评论(0编辑  收藏  举报