mysql简单安装使用
来源:互联网 发布:教武术的软件 编辑:程序博客网 时间:2024/06/14 00:47
centos5.5 64bit上安装使用
1、yum install mysql
2、service mysqld start
如果不执行的话会出现问题
[root@rac1 ~]# mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
执行过程
[root@rac1 ~]# service mysqld start
初始化 MySQL 数据库: Installing MySQL system tables...
OK
Filling help tables...
OK
To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h rac1 password 'new-password'
Alternatively you can run:
/usr/bin/mysql_secure_installation
which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.
See the manual for more instructions.
You can start the MySQL daemon with:
cd /usr ; /usr/bin/mysqld_safe &
You can test the MySQL daemon with mysql-test-run.pl
cd mysql-test ; perl mysql-test-run.pl
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
[确定]
启动 mysqld: [确定]
3、更改数据库root密码
[root@rac1 ~]# mysql -u root -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
[root@rac1 ~]# /usr/bin/mysqladmin -u root password 'loge'
4、然后登陆使用
[root@rac1 ~]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 6
Server version: 5.0.95 Source distribution
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.
5、客户端连接出现问题ERROR 1130
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| test |
+--------------------+
3 rows in set (0.00 sec)
mysql> use mysql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> select host,user from user;
+-----------+------+
| host | user |
+-----------+------+
| 127.0.0.1 | root |
| localhost | |
| localhost | root |
| rac1 | |
| rac1 | root |
+-----------+------+
5 rows in set (0.00 sec)
mysql> update user set host='%' where user='localhost';
Query OK, 0 rows affected (0.01 sec)
Rows matched: 0 Changed: 0 Warnings: 0
mysql> update user set host='%' where host='localhost';
Query OK, 2 rows affected (0.00 sec)
Rows matched: 2 Changed: 2 Warnings: 0
mysql> flush priveges;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'priveges' at line 1
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
记得修改完刷新一下权限
ok!
另外mariadb操作一样
- mysql简单安装使用
- MySQL安装和简单使用
- mysql安装与简单使用
- mysql xtrabackup安装以及简单使用
- 【数据库】MySQL的安装与简单使用
- mysql免安装版简单使用步骤
- Linux下Mysql数据库的配置安装和简单使用
- Mac OS下安装mysql及其简单使用
- elasticsearch 1.5 + mysql安装配置与简单使用
- Mysql 5.6 详细安装步骤及Navicat的简单使用
- Linux下的MySQL安装与简单使用
- Mac OS下安装mysql及其简单使用
- Mac OS下安装mysql及其简单使用
- Mac OS下安装mysql及其简单使用
- Mac OS下安装mysql及其简单使用
- Mac OS下安装mysql及其简单使用
- Linux环境下Mysql的安装及简单使用
- MYSQL数据库在Ubuntu下的安装与简单使用
- Intersection of Two Linked Lists answer [Easy]
- 217 写出输出结果
- 面对一个全新的环境,DBA首先应该做什么?(转载)
- 第三代撒旦撒旦撒
- c#利用libvlc.dll写了一个播放器
- mysql简单安装使用
- 218 N个数出现了偶数次,2个数出现了奇数次,找出这两个数
- 如何在VMvareWorkstation上面配置linux网络
- 为动态数组扩容
- lcd控制器 笔记前序<s3c2440>
- 221 1、三次握手;2、死锁的条件
- java.lang.Error:Properties init:Could not determine current working directory
- 改变MyEclipse的默认编码方式
- static 修饰的成员变量