mysql linux安装yum

1     配置yum

[[email protected] media]# cd Server/

[[email protected] Server]# pwd

/media/Server

[[email protected] Server]# vi/etc/yum.repos.d/rhel-debuginfo.repo

[rhel-debuginfo]

name=Red Hat Enterprise Linux $releasever -$basearch - Debug

baseurl=ftp://ftp.redhat.com/pub/redhat/linux/enterprise/$releasever/en/os/$basearch/Debuginfo/

enabled=0

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

[rhel-debuginfo-beta]

name=Red Hat Enterprise Linux $releaseverBeta - $basearch - Debug

baseurl=ftp://ftp.redhat.com/pub/redhat/linux/beta/$releasever/en/os/$basearch/Debuginfo/

enabled=0

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-beta,file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

[rhel-5.5]

name=rhel5.5

baseurl=file:///media/Server

enabled=1

gpgcheck=0

2     检查是否安装myslq

[[email protected] Server]# yum list installed mysql*

Loaded plugins: rhnplugin, security

This system is not registered with RHN.

RHN support will be disabled.

Error: No matching Packages to list

3     查看yum源中的mysql版本

[[email protected] Server]# yum list|grep mysql

This system is not registered with RHN.

RHN support will be disabled.

apr-util-mysql.x86_64                       1.2.7-11.el5               rhel-5.5

freeradius-mysql.x86_64                     1.1.3-1.6.el5              rhel-5.5

freeradius2-mysql.x86_64                    2.1.7-7.el5                rhel-5.5

libdbi-dbd-mysql.x86_64                     0.8.1a-1.2.2               rhel-5.5

mod_auth_mysql.x86_64                       1:3.0.0-3.2.el5_3          rhel-5.5

mysql.i386                                 5.0.77-4.el5_4.2          rhel-5.5

mysql.x86_64                               5.0.77-4.el5_4.2          rhel-5.5

mysql-bench.x86_64                          5.0.77-4.el5_4.2           rhel-5.5

mysql-connector-odbc.x86_64                 3.51.26r1127-1.el5         rhel-5.5

mysql-devel.i386                           5.0.77-4.el5_4.2          rhel-5.5

mysql-devel.x86_64                          5.0.77-4.el5_4.2           rhel-5.5

mysql-server.x86_64                         5.0.77-4.el5_4.2           rhel-5.5

mysql-test.x86_64                           5.0.77-4.el5_4.2           rhel-5.5

php-mysql.x86_64                            5.1.6-27.el5               rhel-5.5

qt4-mysql.x86_64                            4.2.1-1                    rhel-5.5

rsyslog-mysql.x86_64                        3.22.1-3.el5               rhel-5.5

[[email protected] Server]# yum list installed|grep mysql

This system is not registered with RHN.

RHN support will be disabled.

4     安装mysql

[[email protected] Server]# yum install mysql -y

Loaded plugins: rhnplugin, security

This system is not registered with RHN.

RHN support will be disabled.

Setting up Install Process

Resolving Dependencies

--> Running transaction check

---> Package mysql.i3860:5.0.77-4.el5_4.2 set to be updated

--> Processing Dependency: perl(DBI) forpackage: mysql

---> Package mysql.x86_640:5.0.77-4.el5_4.2 set to be updated

--> Running transaction check

---> Package perl-DBI.x86_640:1.52-2.el5 set to be updated

--> Finished Dependency Resolution

Dependencies Resolved

=======================================================================================================================================================================

Package                               Arch                                Version                                         Repository                             Size

=======================================================================================================================================================================

Installing:

mysql                                 i386                               5.0.77-4.el5_4.2                               rhel-5.5                             4.8 M

mysql                                 x86_64                              5.0.77-4.el5_4.2                                rhel-5.5                              4.8 M

Installing for dependencies:

perl-DBI                              x86_64                              1.52-2.el5                                     rhel-5.5                              605 k

Transaction Summary

=======================================================================================================================================================================

Install       3 Package(s)

Upgrade       0 Package(s)

Total download size: 10 M

Downloading Packages:

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------

Total                                                                                                                                  1.2GB/s |  10 MB     00:00

Running rpm_check_debug

Running Transaction Test

Finished Transaction Test

Transaction Test Succeeded

Running Transaction

Installing     : perl-DBI                                                                                                                                       1/3

Installing     : mysql                                                                                                                                          2/3

Installing     : mysql                                                                                                                                          3/3

Installed:

mysql.i386 0:5.0.77-4.el5_4.2                                                    mysql.x86_64 0:5.0.77-4.el5_4.2

Dependency Installed:

perl-DBI.x86_64 0:1.52-2.el5

Complete!

4.1   安装mysql-server

[[email protected] Server]# yum install mysql-server -y

Loaded plugins: rhnplugin, security

This system is not registered with RHN.

RHN support will be disabled.

Setting up Install Process

Resolving Dependencies

--> Running transaction check

---> Package mysql-server.x86_640:5.0.77-4.el5_4.2 set to be updated

--> Processing Dependency: perl-DBD-MySQLfor package: mysql-server

--> Running transaction check

---> Package perl-DBD-MySQL.x86_640:3.0007-2.el5 set to be updated

--> Finished Dependency Resolution

Dependencies Resolved

=======================================================================================================================================================================

Package                                    Arch                               Version                                     Repository                            Size

=======================================================================================================================================================================

Installing:

mysql-server                               x86_64                             5.0.77-4.el5_4.2                             rhel-5.5                             9.8 M

Installing for dependencies:

perl-DBD-MySQL                             x86_64                             3.0007-2.el5                                 rhel-5.5                             147 k

Transaction Summary

=======================================================================================================================================================================

Install       2 Package(s)

Upgrade       0 Package(s)

Total download size: 10 M

Downloading Packages:

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------

Total                                                                                                                                 3.9 GB/s |  10 MB     00:00

Running rpm_check_debug

Running Transaction Test

Finished Transaction Test

Transaction Test Succeeded

Running Transaction

Installing     :perl-DBD-MySQL                                                                                                                                 1/2

Installing     : mysql-server                                                                                                                                    2/2

Installed:

mysql-server.x86_64 0:5.0.77-4.el5_4.2

Dependency Installed:

perl-DBD-MySQL.x86_64 0:3.0007-2.el5

Complete!

4.2   安装mysql-devel

[[email protected] Server]# yum install mysql-devel -y

Loaded plugins: rhnplugin, security

This system is not registered with RHN.

RHN support will be disabled.

Setting up Install Process

Resolving Dependencies

--> Running transaction check

---> Package mysql-devel.i3860:5.0.77-4.el5_4.2 set to be updated

---> Package mysql-devel.x86_640:5.0.77-4.el5_4.2 set to be updated

--> Finished Dependency Resolution

Dependencies Resolved

=======================================================================================================================================================================

Package                                 Arch                               Version                                         Repository                            Size

=======================================================================================================================================================================

Installing:

mysql-devel                             i386                              5.0.77-4.el5_4.2                               rhel-5.5                            2.4 M

mysql-devel                             x86_64                             5.0.77-4.el5_4.2                                rhel-5.5                             2.5 M

Transaction Summary

=======================================================================================================================================================================

Install       2 Package(s)

Upgrade       0 Package(s)

Total download size: 4.9 M

Downloading Packages:

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------

Total                                                                                                                                 1.4 GB/s | 4.9 MB     00:00

Running rpm_check_debug

Running Transaction Test

Finished Transaction Test

Transaction Test Succeeded

Running Transaction

Installing     : mysql-devel                                                                                                                                    1/2

Installing     : mysql-devel                                                                                                                                    2/2

Installed:

mysql-devel.i386 0:5.0.77-4.el5_4.2                                              mysql-devel.x86_64 0:5.0.77-4.el5_4.2

Complete!

5     修改默认字符集

[[email protected] Server]# vi /etc/my.cnf

[mysqld]

datadir=/var/lib/mysql

socket=/var/lib/mysql/mysql.sock

user=mysql

# Default to using old password format forcompatibility with mysql 3.x

# clients (those using the mysqlclient10compatibility package).

old_passwords=1

default-character-set=utf8

# Disabling symbolic-links is recommendedto prevent assorted security risks;

# to do so, uncomment this line:

# symbolic-links=0

[mysqld_safe]

log-error=/var/log/mysqld.log

pid-file=/var/run/mysqld/mysqld.pid

6     启停mysql

[[email protected] Server]# service mysqld start

[[email protected] Server]# service mysqld stop

7     修改mysql root密码

[[email protected] Server]# mysqladmin -u root password love8013

7.1   登录mysql

[[email protected] Server]# mysql -u [email protected]

Welcome to the MySQL monitor.  Commands end with ; or \g.

Your MySQL connection id is 4

Server version: 5.0.77 Source distribution

Type ‘help;‘ or ‘\h‘ for help. Type ‘\c‘ toclear the buffer.

mysql>

7.2   创建db

mysql> showdatabases;

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

| Database           |

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

| information_schema |

| test               |

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

2 rows in set (0.00 sec)

mysql> createdatabase ocp;

ERROR 1044 (42000): Access denied for user‘‘@‘localhost‘ to database ‘ocp‘

窗口1

[[email protected] Server]# service mysqld stop

Stopping MySQL:                                           [  OK  ]

[[email protected] Server]# mysqld_safe --skip-grant-table

Starting mysqld daemon with databases from/var/lib/mysql

窗口2

[[email protected] ~]# mysql -u root mysql

Reading table information for completion oftable and column names

You can turn off this feature to get aquicker startup with -A

Welcome to the MySQL monitor.  Commands end with ; or \g.

Your MySQL connection id is 1

Server version: 5.0.77 Source distribution

Type ‘help;‘ or ‘\h‘ for help. Type ‘\c‘ toclear the buffer.

mysql> delete from user where user=‘‘;

Query OK, 2 rows affected (0.00 sec)

mysql> flush privileges;

Query OK, 0 rows affected (0.00 sec)

mysql> \q

Bye

[[email protected] ~]# mysql -u root -p  love8013

Enter password:

ERROR 1049 (42000): Unknown database‘love8013‘

[[email protected] ~]# mysql -u root -p

Enter password:

Welcome to the MySQL monitor.  Commands end with ; or \g.

Your MySQL connection id is 3

Server version: 5.0.77 Source distribution

Type ‘help;‘ or ‘\h‘ for help. Type ‘\c‘ toclear the buffer.

mysql> show databases;

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

| Database           |

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

| information_schema |

| mysql              |

| test               |

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

3 rows in set (0.00 sec)

mysql> create database ocp;

Query OK, 1 row affected (0.00 sec)

mysql> show databases;

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

| Database           |

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

| information_schema |

| mysql              |

| ocp                |

| test               |

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

4 rows in set (0.00 sec)

时间: 2024-10-13 09:46:59

mysql linux安装yum的相关文章

Mysql linux 安装文档

1.安装依赖包 yum -y install gcc-c++ ncurses-devel cmake make perl gcc autoconf automake zlib libxml libgcrypt libtool bison 2.安装boost库: 首先先查询是否已经安装过boost rpm -qa boost* 卸载旧boost-*等库: yum -y remove boost-* 下载Boost库,在解压后复制到/usr/local/boost目录下,然后重新cmake并在后面的

Linux安装yum的痛苦路程(失败,慎入)

1,在网上下载了一个yum 的 rpm文件(yum-3.2.29-81.el6.centos.noarch.rpm),我在 http://www.rpmfind.net/linux/rpm2html/search.php?query=yum&submit=Search+...&system=&arch= 这里下载的,也可以在官网下. 2,按照安装命令走:#rpm -ivh yum-3.2.29-81.el6.centos.noarch.rpm 结果报错:错误信息 3,只能再去安装p

mysql Linux 安装 远程访问设置(Ubuntu)

Ununtu安装MySQL需要三个指令: 1. 指令一 # sudo apt-get install mysql-server // 执行过程中会提示输入密码和重复输入密码(直接输入密码即可),如下图(图1.图2) 图1: 图2 2.指令二.指令三 # apt-get isntall mysql-client # sudo apt-get install libmysqlclient-dev 3.检查安装是否成功 # sudo netstat -tap | grep mysql // 如果显示有

mysql linux安装

Mysql(使用版本5.7.25) 1.  检查是否已安装 #rpm -qa|grep -i mysql 2.  下载安装包 网址:https://dev.mysql.com/downloads/mysql/5.7.html#downloads 3. 放入/root 4. 切换目录 #cd /usr/local/src 5. 解压缩文件 #tar -zxvf  /root/mysql-5.7.25-el7-x86_64.tar.gz 6. #mv /root/mysql-5.7.25-el7-x

Linux安装yum源码包及相关操作

一.使用场景 很多时候下载的rpm包所提供的功能并不符合我们的需要,或者只需要使用其中一部分功能的时候,就需要进行源码安装.源码安装前,首先使用 yum grouplist 确认 Development tools 和 Server Platform Development这两个组已经被安装. 二.相关知识详解 1.make工具 所有的程序都需要gcc编译后才能执行,项目的开发者为了简化使用者的编译步骤,当时用make工具后,make会调用gcc对程序进行编译,所以说make是一种项目编译工具,

Linux安装tomcat及mysql

linux安装tomcat 下载Linux版本tomcat将它放在usr/local中,并且解压缩 tar -zxvf apache-tomcat-7.0.73.tar.gz 然后改名为tomcat 然后我们就同在windows环境下一般使用tomcat,启动 sh ./usr/local/tomcat/bin/startup.sh 停止tomcat sh ./usr/local/tomcat/bin/shutdown.sh [注意关闭防火墙或者在配置文件中允许此端口] linux 安装mysq

linux下yum安装及配置

1 2 3 4 分步阅读 公司使用的是linux搭建服务器,linux安装软件能够使用yum安装依赖包是一件非常简单而幸福的事情,所以这里简单介绍一下linux安装yum源流程和操作. 工具/原料 电脑 linux基础操作知识 方法/步骤 1 查看.卸载已安装的yum包 查看已安装的yum包 #rpm –qa|grep yum 卸载软件包 #rpm –e –nodeps yum 2 下载安装依赖包python python-iniparse 下载地址http://centos.ustc.edu.

Linux 安装mysql4.0.25

MySQL是一个关系型数据库管理系统,由瑞典MySQL AB公司开发,目前属于Oracle公司.Mysql是最流行的关系型数据库管理系统,在WEB应用方面MySQL是最好的RDBMS(Relational Database Management System:关系数据库管理系统)应用软件之一.MySQL是一种关联数据库管理系统,关联数据库将数据保存在不同的表中,而不是将所有数据放在一个大仓库内,这样就增加了速度并提高了灵活性.MySQL所使用的SQL语言是用于访问数据库的最常用标准化语言.MyS

linux安装php出现的各种错误解决方案

configure: error: Try adding --with-zlib-dir=<DIR>. Please check config.log for more information. -------------------------------------------------------------- 解决方案:下载zlib 安装解压缩zlib 然后在后面的参数加上 --with-zlib ./configure --prefix=/usr/local/php --with-