Home > Database > Mysql Tutorial > linux下如何安装新版的mysql

linux下如何安装新版的mysql

WBOY
Release: 2016-06-07 15:08:59
Original
1319 people have browsed it

欢迎进入Linux社区论坛,与200万技术人员互动交流 >>进入 Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql mysql mysql mysql select version(); +-----------+ | version() | +-----------+ | 5.5.29 | +-----

欢迎进入Linux社区论坛,与200万技术人员互动交流 >>进入

 

  Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

  mysql>

  mysql>

  mysql>

  mysql> select version();

  +-----------+

  | version() |

  +-----------+

  | 5.5.29    |

  +-----------+

  1 row in set (0.00 sec)

  注:如果没有安装mysql client,就不会有mysql,mysqladmin等命令。

  或者用如下命令登录mysql:

  #mysql -u root -p

  Enter password: (输入密码)

  其中-u后跟的是用户名,-p要求输入密码,回车后在输入密码处输入密码。

  注意:这个mysql文件在/usr/bin目录下,与后面讲的启动文件/etc/init.d/mysql不是一个文件。

  在安装mysql5.6的时候,安装包随机给root用户生成了一个密码,该密码在'/root/mysql_secret'文件里。

  当使用mysql -u root -p [password]登录后,需要使用如下命令更改密码:

  mysql> SET PASSWORD=PASSWORD('123456');

  如果不执行set password,就执行其他命令,就会碰到如下错误:

  ERROR 1820 (HY000): You must SET PASSWORD before executing this statement

  7.生成my.cnf文件

  默认情况下mysql是不会生成my.cnf文件的,但可以进入到/usr/share/mysql/目录找一个cnf文件生成my.cnf文件,如下:

  cp /usr/share/mysql/my-huge.cnf /etc/my.cnf

  然后编辑my.cnf,按照需要修改或添加相应参数。

  [1] [2] 

linux下如何安装新版的mysql

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template