一、测试环境如下: 1、VmwareWorkStation:6.0.2 build-59824 2、Mysql 数据库的版本: 服务器端:MySQL-server-5.5.19-1.linux2.6.i386.rpm 客 户 端:MySQL-client-5.5.19-1.linux2.6.i386.rpm 3、需要的插件包:libaio-0.3.105-2.i386.rpm 4、Linux版本:RedHat Linux AS 4二、执行安装 1、[root@ssbsc mysql]# rpm -ivh libaio-0.3.105-2.i386.rpm 2、[root@ssbsc mysql]# rpm -ivh MySQL-server-5.5.19-1.linux2.6.i386.rpm 3、[root@ssbsc mysql]# rpm -ivh MySQL-client-5.5.19-1.linux2.6.i386.rpm三、验证 使用netstat -nat 命令进行验证,看mysql数据库是否已经启动。 [root@ssbsc mysql]# netstat -nat
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 :::3306 :::* LISTEN 观察到Local Address的3306端口已经开启,说明服务已经启动,如果没有启动可以使用如下命令进行开启: [root@ssbsc mysql]# service mysql start
Starting MySQL.. [ OK ]四、登录MySQL 登录MySQL的命令是mysql, mysql 的使用语法如下: mysql [-u username] [-h host] [-p[password]] [dbname] username 与 password 分别是 MySQL 的用户名与密码,mysql的初始管理帐号是root,没有密码。在这里我 设置了密码,所以采用有密码的方式进行登录。 [root@ssbsc mysql]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 2
Server version: 5.5.19 MySQL Community Server (GPL) Copyright (c) 2000, 2011, 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>,则证明你已经成功登录了。五、在Windows 操作系统上利用Navicat for MySQL登录Linux系统上刚才安装的Mysql数据库通常情况下会遇到的问题:Error1: 2003:Can"t connect to MySQL server on "localhost"
解决方法:关闭Linux的防火墙功能,或者设置容许TCP协议的3306端口通过,可以下使用如下命令开启TCP协议的3306端口[root@bugzilla ~]# more /etc/sysconfig/iptables
-A RH-Firewall-1-INPUT -p tcp --dport 3306 -j ACCEPT
Error2: 1130 - Host"ClientIP" is not allowed to connect to this MySQL server
解决方法:使用root 用户登陆Linux,登陆MySQL的root用户,更改容许登陆的IP地址范围。 [root@bugzilla ~]# mysql -u root -p
mysql>grant all privileges on *.* to "root"@"%" identified by "your password" with grant option;
这段指令容许所有用root用户输入密码登陆该mysql server,如果将"%" 换成"192.168.1.208" ,那么只有"192.168.1.208"的主机可以登陆。Oracle中查找用户表和用户表字段等MySQL在Linux系统上的基本操作相关资讯 MySQL基础教程
- MySQL基础教程:关于varchar(N) (01月22日)
- MySQL SELECT同时UPDATE同一张表 (02/19/2013 07:20:18)
- Linux修改MySQL最大并发连接数 (02/15/2013 15:37:21)
| - 高性能MySQL(第3版) 中文PDF带目 (10/26/2014 10:03:50)
- 如何在MySQL中的获取IP地址的网段 (02/18/2013 12:23:33)
- C++和C#访问MySQL的简单代码示例 (12/21/2012 09:04:10)
|
本文评论 查看全部评论 (0)