linux下安装mysql的问题解决

今天试了下在Linux下安装mysql,我只选了server和client两个组件,没有装其他的组件.
安装包的下载可以参见 http://www.mysql.com/downloads/

server端的安装:
[root@oel2 install_mysql]# rpm -ivh MySQL-server-advanced-5.6.14-1.rhel5.i386.rpm
Preparing...                ########################################### [100%]
   1:MySQL-server-advanced  ########################################### [100%]
2013-12-08 21:49:03 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2013-12-08 21:49:03 17530 [Note] InnoDB: The InnoDB memory heap is disabled
2013-12-08 21:49:03 17530 [Note] InnoDB: Mutexes and rw_locks use InnoDB's own implementation
2013-12-08 21:49:03 17530 [Note] InnoDB: Compressed tables use zlib 1.2.3
2013-12-08 21:49:03 17530 [Note] InnoDB: Using Linux native AIO
2013-12-08 21:49:03 17530 [Note] InnoDB: Not using CPU crc32 instructions
2013-12-08 21:49:03 17530 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2013-12-08 21:49:03 17530 [Note] InnoDB: Completed initialization of buffer pool
2013-12-08 21:49:03 17530 [Note] InnoDB: The first specified data file ./ibdata1 did not exist: a new database to be created!
2013-12-08 21:49:03 17530 [Note] InnoDB: Setting file ./ibdata1 size to 12 MB
2013-12-08 21:49:03 17530 [Note] InnoDB: Database physically writes the file full: wait...
2013-12-08 21:49:04 17530 [Note] InnoDB: Setting log file ./ib_logfile101 size to 48 MB
2013-12-08 21:49:06 17530 [Note] InnoDB: Setting log file ./ib_logfile1 size to 48 MB
2013-12-08 21:49:09 17530 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0
2013-12-08 21:49:09 17530 [Warning] InnoDB: New log files created, LSN=45781
2013-12-08 21:49:09 17530 [Note] InnoDB: Doublewrite buffer not found: creating new
2013-12-08 21:49:09 17530 [Note] InnoDB: Doublewrite buffer created
2013-12-08 21:49:09 17530 [Note] InnoDB: 128 rollback segment(s) are active.
2013-12-08 21:49:10 17530 [Warning] InnoDB: Creating foreign key constraint system tables.
2013-12-08 21:49:10 17530 [Note] InnoDB: Foreign key constraint system tables created
2013-12-08 21:49:10 17530 [Note] InnoDB: Creating tablespace and datafile system tables.
2013-12-08 21:49:10 17530 [Note] InnoDB: Tablespace and datafile system tables created.
2013-12-08 21:49:10 17530 [Note] InnoDB: Waiting for purge to start
2013-12-08 21:49:10 17530 [Note] InnoDB: 5.6.14 started; log sequence number 0
2013-12-08 21:49:10 17530 [Note] RSA private key file not found: /var/lib/mysql//private_key.pem. Some authentication plugins will not work.
2013-12-08 21:49:10 17530 [Note] RSA public key file not found: /var/lib/mysql//public_key.pem. Some authentication plugins will not work.
A random root password has been set. You will find it in '/root/.mysql_secret'.
2013-12-08 21:49:12 17530 [Note] Binlog end
2013-12-08 21:49:12 17530 [Note] InnoDB: FTS optimize thread exiting.
2013-12-08 21:49:12 17530 [Note] InnoDB: Starting shutdown...
2013-12-08 21:49:13 17530 [Note] InnoDB: Shutdown completed; log sequence number 1625977

2013-12-08 21:49:13 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2013-12-08 21:49:13 17568 [Note] InnoDB: The InnoDB memory heap is disabled
2013-12-08 21:49:13 17568 [Note] InnoDB: Mutexes and rw_locks use InnoDB's own implementation
2013-12-08 21:49:13 17568 [Note] InnoDB: Compressed tables use zlib 1.2.3
2013-12-08 21:49:13 17568 [Note] InnoDB: Using Linux native AIO
2013-12-08 21:49:13 17568 [Note] InnoDB: Not using CPU crc32 instructions
2013-12-08 21:49:13 17568 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2013-12-08 21:49:13 17568 [Note] InnoDB: Completed initialization of buffer pool
2013-12-08 21:49:13 17568 [Note] InnoDB: Highest supported file format is Barracuda.
2013-12-08 21:49:13 17568 [Note] InnoDB: 128 rollback segment(s) are active.
2013-12-08 21:49:13 17568 [Note] InnoDB: Waiting for purge to start
2013-12-08 21:49:13 17568 [Note] InnoDB: 5.6.14 started; log sequence number 1625977
2013-12-08 21:49:13 17568 [Note] RSA private key file not found: /var/lib/mysql//private_key.pem. Some authentication plugins will not work.
2013-12-08 21:49:13 17568 [Note] RSA public key file not found: /var/lib/mysql//public_key.pem. Some authentication plugins will not work.
2013-12-08 21:49:13 17568 [Note] Binlog end
2013-12-08 21:49:13 17568 [Note] InnoDB: FTS optimize thread exiting.
2013-12-08 21:49:13 17568 [Note] InnoDB: Starting shutdown...
2013-12-08 21:49:15 17568 [Note] InnoDB: Shutdown completed; log sequence number 1625987

A RANDOM PASSWORD HAS BEEN SET FOR THE MySQL root USER !
You will find that password in '/root/.mysql_secret'.

You must change that password on your first connect,
no other statement but 'SET PASSWORD' will be accepted.
See the manual for the semantics of the 'password expired' flag.

Also, the account for the anonymous user has been removed.
In addition, you can run:
  /usr/bin/mysql_secure_installation

which will also give you the option of removing the test database.
This is strongly recommended for production servers.
See the manual for more instructions.
Please report any problems with the /usr/bin/mysqlbug script!
The latest information about MySQL is available on the web at
  http://www.mysql.com
Support MySQL by buying support/licenses at http://shop.mysql.com
New default config file was created as /usr/my.cnf and
will be used by default by the server when you start it.
You may edit this file to change server settings

client端的安装:
[root@oel2 install_mysql]# rpm -ivh MySQL-client-advanced-5.6.14-1.rhel5.i386.rpm
Preparing...                ########################################### [100%]
   1:MySQL-client-advanced  ########################################### [100%]

[mysql@oel2 bin]$ yum list installed mysql\*
Loaded plugins: security
Installed Packages
MySQL-client-advanced.i386                     5.6.14-1.rhel5                      installed
MySQL-server-advanced.i386                     5.6.14-1.rhel5                      installed
[mysql@oel2 bin]$ 

启动服务

[root@oel2 ~]# service mysql start
Starting MySQL..                                           [  OK  ]
检查mysql端口3306是否正常
[root@oel2 ~]# netstat -nat|grep 3306
tcp        0      0 :::3306                     :::*                        LISTEN      
[

连接的时候总是报错。错误大概有如下几种。
[root@oel2 ~]# mysql -u root
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
[root@oel2 ~]# mysql -u root
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
[root@oel2 ~]# mysqladmin -u root -p password '123456'
Enter password: 
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: YES)'

[root@oel2 ~]# /etc/init.d/mysql stop 
Shutting down MySQL..                                      [  OK  ]

[root@oel2 ~]# mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
[1] 26352
131208 22:58:35 mysqld_safe Logging to '/var/lib/mysql/oel2.err'.
131208 22:58:35 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql

[root@oel2 ~]# mysql -u root mysql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.6.14-enterprise-commercial-advanced MySQL Enterprise Server - Advanced Edition (Commercial)
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> update user set password=password('mysql') where user='root';
Query OK, 4 rows affected (0.08 sec)
Rows matched: 4  Changed: 4  Warnings: 0
mysql> flush privileges;
Query OK, 0 rows affected (0.05 sec)
mysql> quit
Bye
[root@oel2 ~]# /etc/init.d/mysql restart
Shutting down MySQL..131208 22:59:59 mysqld_safe mysqld from pid file /var/lib/mysql/oel2.pid ended
                                                           [  OK  ]
Starting MySQL..                                           [  OK  ]
[1]+  Done                    mysqld_safe --user=mysql --skip-grant-tables --skip-networking
[root@oel2 ~]# mysql -uroot -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.6.14-enterprise-commercial-advanced
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> 
mysql> show databases;
ERROR 1820 (HY000): You must SET PASSWORD before executing this statement

mysql> SET PASSWORD = PASSWORD('mysql');
Query OK, 0 rows affected (0.00 sec)

mysql> create database test;
ERROR 1007 (HY000): Can't create database 'test'; database exists
mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| test               |
+--------------------+
4 rows in set (0.01 sec)

时间: 2024-09-30 01:23:18

linux下安装mysql的问题解决的相关文章

Linux下安装MySQL出现“ls: /var/lib/mysql/*.pid: 没有那个文件或目录”

环境 RedHat Linux 9 + VWWare 8.0 + SSH 3.2.9 + Putty 0.62 + MySQL 3.2 + MySQL 5.5 问题 Linux下安装MySQL出现如下错误: warning: MySQL-server-5.5.28-1.linux2.6.i386.rpm: V3 DSA signature: NOKEY, key ID 5072e1f5 Preparing... ##########################################

Linux下安装MySql+Apache2+PHP5.3.1教程

Linux下安装MySql+Apache2+PHP5.3.1教程 请先下载下面三个安装必要的软件   01-04php-5.3.1.tar.gz.html">php-5.3.1.tar.gz安装包下载 01-04httpd-2.2.14.tar.gz 安装包下载 01-04mysql-5.1.42-linux-i686-glibc23.tar.gz.html">mysql-5.1.42-linux-i686-glibc2   一.安装apache2-------------

Linux下安装mysql+apache+php指南

.mysql教程 在如下页面下载mysql的for linux rpm包 http://www.mysql.com/downloads/down...3.52-1.i386.rpm http://www.mysql.com/downloads/down...3.52-1.i386.rpm 存至/home/tmp目录 命令列表: cd /home/tmp rpm -ivh mysql-3.23.52-1.i386.rpm           //#安装mysql server rpm -ivh m

[Linux基础环境/软件]Linux下安装mysql

我是使用免安装的包mysql-5.5.28-linux2.6-x86_64.tar.gz(在http://dev.mysql.com/downloads/可以下载到最新的包)的.直接解压,然后配置,初始化数据库,启动即可. 安装步骤有: 解压和建立软链: 配置文件和配置参数: 初始化数据库: 启动和关闭: 建立数据库用户和授权.   1. 解压和建立软链: #tar xzvf mysql-5.5.28-linux2.6-x86_64.tar.gz #在/usr/local目录下 #ln -s m

linux下安装mysql

前期准备 查看mysql安装路径 [root@root mysql-5.6.12]# whereis mysql mysql: /usr/lib64/mysql /usr/local/mysql /usr/share/mysql 查看mysql安装包 [root@root mysql-5.6.12]# rpm -qa|grep mysql mysql-libs-5.1.73-5.el6_6.x86_64 mysql-server-5.1.73-5.el6_6.x86_64 卸载mysql [ro

Linux下安装Mysql多实例作为数据备份服务器实现多主到一从多实例的备份_Mysql

1.从MYSQL官方下载MYSQL的源码版本[一定要是源码版本] 2.按以下代码键入LINUX命令行 复制代码 代码如下: [注] 添加mysql组和用户 #groupadd mysql #useradd -g mysql mysql [注] 解包到/usr/local # tar -xzf mysql-standard-4.1.9-pc-linux-gnu-i686.tar.gz -C /usr/local [注] 建立软链接,方便操作(此处给此连接命名为mysql001,也可为其它的名字)

Linux 下卸载MySQL 5

    对于在Linux下通过rpm方式的mysql,我们可以通过移除这些rpm包以及删除项目的目录来达到卸载的目的.本文演示了在SUSE Linux 10下下载MySQL 5.5.37.具体见下文.   1.环境#OS环境SZDB:~ # cat /etc/issue Welcome to SUSE Linux Enterprise Server 10 SP3 (x86_64) - Kernel \r (\l). #查看已安装的安装包SZDB:~ # rpm -qa | grep -i mys

liunx环境下安装mysql数据库

一:如果你的机器上之前安装有mysql数据库,先进行卸载 (1)需要先将它的文件删除   (2)同时注意删除老板本的etc/my.cnf文件和/etc/mysql目录,这两个文件控制的是mysql的一些配置属性.   二:去官网下载mysql安装文件 在Linux下安装MySQL有三种方式:第一种以rpm的二进制文件分个安装,第二种是自己编译源码后安装,最后一种是以二进制tar.gz文件来安装. 这三种中,由于最后一种是统一的整体文件,个人感觉最简单,故本文将采用此方式来进行安装: 首先到mys

我也很纳闷,网上linux下安装appache,mysql之类的软件,都有好长一段代码来配置修改文件

问题描述 我也很纳闷,网上linux下安装appache,mysql之类的软件,都有好长一段代码来配置修改文件该问题来自CSDNDocker技术交流群(303806405),由版主xinshubiao整理.