文章信息

大数据实战学习笔记8-安装Mysql服务并测试

发布时间:『 2019-07-10 01:46』  文章类别:学习日志  阅读(1266) 评论(0)

以下笔记为简略记录,详细实战内容待补充。

修改yum源

http://mirrors.aliyun.com/repo/Centos-6.repo

[zeal@data1 ~]$ cd /etc/yum.repos.d/

[zeal@data1 yum.repos.d]$ sudo vi CentOS-Base.repo

[root@data1 yum.repos.d]# yum clean all

[root@data1 yum.repos.d]# yum install mysql-server

[root@data1 /]# which mysql

/usr/bin/mysql

[root@data1 /]# service mysqld status

mysqld 已停

[root@data1 /]# 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 data1.zeal.name 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 /usr/mysql-test ; perl mysql-test-run.pl


Please report any problems with the /usr/bin/mysqlbug script!


                                                           [确定]

正在启动 mysqld:                                          [确定]

[root@data1 /]# /usr/bin/mysqladmin -u root password '123456'

[zeal@data1 yum.repos.d]$ mysql -uroot -p123456

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

Your MySQL connection id is 3

Server version: 5.1.73 Source distribution


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> show databases;

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

| Database           |

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

| information_schema |

| mysql              |

| test               |

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

3 rows in set (0.00 sec)


mysql> use test

Database changed

mysql> show tables;

Empty set (0.00 sec)


mysql> exit

Bye


关键字:  mysql  大数据  linux
评论信息
暂无评论
发表评论
验证码: 
当前时间
小主信息

愿历尽千帆,归来仍少年。
3D标签云

Anything in here will be replaced on browsers that support the canvas element

友情链接

Copyright ©2017-2024 uzen.zone
湘ICP备17013178号-3