Linux MySQL自己环境搭建的笔记

系统 1652 0
cd /usr/share/selinux
setenforce 0
tar -xvf MySQL-5.6.12-1.el6.x86_64.rpm-bundle.tar
rpm -qa|grep -i mysql
yum -y remove mysql-libs*
rpm -e mysql*
rpm -ivh MySQL-server-5.6.12-1.el6.x86_64.rpm
rpm -ivh MySQL-client-5.6.12-1.el6.x86_64.rpm
rpm -ivh MySQL-devel-5.6.12-1.el6.x86_64.rpm
service mysql stop
vim /etc/selinux/config
SELINUX=disabled
cp ./usr/share/doc/MySQL-server-5.6.12/my-default.cnf /etc/my.cnfvim /etc/my.cnf
 
      [client]

default-character-set = gbk

port    = 3306

socket  = /mydata/mysql.sock



[mysqld]

character-set-server = gbk

datadir = /mydata/mysql

socket  = /mydata/mysql/mysql.sock

pid-file = /mydata/mysql/mysql.pid 

#key-buffer-size = 1024M

user=mysql

skip-name-resolve



#innodb_tablespace

innodb_data_home_dir = /mydata/mysql

innodb_log_group_home_dir = /mydata/mysql

innodb_data_file_path= indata01:512M:autoextend:max:512M

#innodb_log_group_home_dir = 

#innodb_data_file_path= /dev/raw/raw1:64Mnewraw

innodb_file_per_table=0



#innodb_perf_parameter

innodb_buffer_pool_size = 1024M

innodb_log_file_size = 64M

innodb_log_buffer_size =16M

innodb_flush_log_at_trx_commit = 2



sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES 


    
  

vim .bash_profile

 

      alias pp='ps -ef|grep mysql'

export MYDATA_HOME=/mydata


    

    ==

    
      mkdir /mydata
      
chown mysql:mysql -R /mydata
关机加盘
fdisk -l认盘
fdisk  /dev/sdb
输入m、输入n、输入PrimaryPartID,2,回车到底,输入w
start_udev 为后续RawDevice做准备
vgcreate -s 4M datavg /dev/sdb
lvcreate -L 980M -n data_lv datavg
mke2fs -j -b 4096 /dev/datavg/data_lv
mount -t ext3 /dev/datavg/data_lv /mydata
mv /var/lib/mysql /mydata
===
cat /root/.secret
mysql -uroot -pXXXXXXXXXX mysql

    
      
        
          
            mysql_install_db --user=mysql --basedir=/usr --datadir=/mydata
            
mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
mysql -u root mysql
mysql> UPDATE user SET Password=PASSWORD('111') where USER='root';
mysql> FLUSH PRIVILEGES;
mysql> quit;
pp
kill -9 xxxx
/usr/sbin/mysqld  --datadir=/mydata --pid-file=/mydata/mysql.pid &
mysql -uroot -p111
mysql> SET PASSWORD = PASSWORD('123');
mysql> show variables like '%char%';  
mysql> use mysql;
mysql> update user set host = '%' where user = 'root';
mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'192.168.137.1' IDENTIFIED BY '123' WITH GRANT OPTION;
mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'192.167.137.102' IDENTIFIED BY '123' WITH GRANT OPTION;
mysql> select user,host from user;
    
      
        
          
            mysql> 
          
        
      
    
    
      set sql_mode='no_auto_create_user,no_engine_substitution';
    
  
    
      
         
      
    
  
    
       
    
  

Linux MySQL自己环境搭建的笔记


更多文章、技术交流、商务合作、联系博主

微信扫码或搜索:z360901061

微信扫一扫加我为好友

QQ号联系: 360901061

您的支持是博主写作最大的动力,如果您喜欢我的文章,感觉我的文章对您有帮助,请用微信扫描下面二维码支持博主2元、5元、10元、20元等您想捐的金额吧,狠狠点击下面给点支持吧,站长非常感激您!手机微信长按不能支付解决办法:请将微信支付二维码保存到相册,切换到微信,然后点击微信右上角扫一扫功能,选择支付二维码完成支付。

【本文对您有帮助就好】

您的支持是博主写作最大的动力,如果您喜欢我的文章,感觉我的文章对您有帮助,请用微信扫描上面二维码支持博主2元、5元、10元、自定义金额等您想捐的金额吧,站长会非常 感谢您的哦!!!

发表我的评论
最新评论 总共0条评论