red5下mysql安装配置

阅读更多
1.查看本机已安装的mysql程序
rpm -qa |grep mysql 


2.卸载已安装的mysql
rpm -e mysql-3.23.49-3 -nodeps 


3.开始安装mysql
    
     shell> groupadd mysql
     shell> useradd -g mysql mysql
     shell> gunzip < mysql-VERSION.tar.gz | tar -xvf -
     shell> cd mysql-VERSION

     shell> ./configure --prefix=/usr/local/mysql --enable-thread-safe-client --enable-local-infile --with-charset=gbk --with-extra-charsets="gbk gb2312 big5 utf8" --with-low-memory

     shell> make
     shell> make install

     shell> cp support-files/my-medium.cnf /etc/my.cnf
     shell> cd /usr/local/mysql

     shell> chown -R mysql .
     shell> chgrp -R mysql .
     shell> bin/mysql_install_db --user=mysql
     shell> chown -R root .
     shell> chown -R mysql var


4.启动服务

 ./bin/mysqld_safe --user=mysql & 


5.增加mysql环境变量,退出保存
vi /etc/profile 
/usr/local/mysql/bin:


进入 usr/local/mysql 目录

输入命令 ./bin/mysql -u root -p 登录mysql

停止服务 /usr/bin/mysqladmin -u root -p shutdown

查看mysql是否启动命令
ps -aux | grep mysqld 


查看mysql是否在监听端口命令
netstat -tl | grep mysql 


修改密码
1.mysqladmin -u root password 'root'

2.mysql>UPDATE user SET password=PASSWORD(‘new_password’) WHERE user=’root’;
  mysql>FLUSH PRIVILEGES; 


3.mysql>set password for lqw=password("admin");


用户授权
GRANT ALL ON *.* TO root@'%' IDENTIFIED BY 'root'  授权远

程登陆用户 
   
GRANT ALL ON *.*(databasename.tablename) TO 'username'@'localhost' IDENTIFIED BY 'userpassword'; (授权)


开机启动:
3,开机启动
在/etc/rc.local里加入

/usr/local/mysql/bin/mysqld_safe --user=mysql &

你可能感兴趣的:(MySQL,Java,thread)