大数据MySQL安装简单设置(1)

登录mysql ,简单设置相关用户和密码
.Login mysql
[mysqladmin@sht-sgmhadoopnn-01 ~]$ mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.6.23-log MySQL Community Server (GPL)

Copyright © 2000, 2015, 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 |
| performance_schema |
| test |
±-------------------+
4 rows in set (0.00 sec)

11.Update password and Purge user

mysql> use mysql
Database changed

mysql> select user,password,host from user;
±-----±---------±----------+
| user | password | host |
±-----±---------±----------+
| root | | localhost |
| root | | hadoop000 |
| root | | 127.0.0.1 |
| root | | ::1 |
| | | localhost |
| | | hadoop000 |
±-----±---------±----------+
rows in set (0.00 sec)
用户 密码 能够允许外在的机器来访问
mysql> update user set password=password(‘123456’) where user=‘root’;
mysql> select host,user,password from user;
±---------------±-----±------------------------------------------+
| host | user | password |
±---------------±-----±------------------------------------------+
| localhost | root | *6340BE3C15D246B0D74BAF3F135915ED19E0069F |
| sht-sgmhadoopnn-01 | root | *6340BE3C15D246B0D74BAF3F135915ED19E0069F |
| 127.0.0.1 | root | *6340BE3C15D246B0D74BAF3F135915ED19E0069F |
| ::1 | root | *6340BE3C15D246B0D74BAF3F135915ED19E0069F |
| localhost | | |
| sht-sgmhadoopnn-01 | | |
±---------------±-----±------------------------------------------+
6 rows in set (0.00 sec)

mysql> delete from user where user=’’;
mysql> select host,user,password from user;
±---------------±-----±------------------------------------------+
| host | user | password |
±---------------±-----±------------------------------------------+
| localhost | root | *6340BE3C15D246B0D74BAF3F135915ED19E0069F |
| sht-sgmhadoopnn-01 | root | *6340BE3C15D246B0D74BAF3F135915ED19E0069F |
| 127.0.0.1 | root | *6340BE3C15D246B0D74BAF3F135915ED19E0069F |
| ::1 | root | *6340BE3C15D246B0D74BAF3F135915ED19E0069F |
±---------------±-----±------------------------------------------+
4 rows in set (0.00 sec)
mysql> flush privileges; ----重新加载权限表; 更新权限;—

Configure .bash_profile
[mysqladmin@sht-sgmhadoopnn-01 ~]$ cat .bash_profile

.bash_profile

Get the aliases and functions

if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi

User specific environment and startup programs

User specific environment and startup programs

export MYSQL_HOME=/usr/local/mysql
export PATH= M Y S Q L H O M E / b i n : MYSQL_HOME/bin: PATH

Remark:
Error1: File ‘/usr/local/mysql/arch/mysql-bin.index’ not found (Errcode: 13)
test2.localdomain:mysqladmin:/usr/local/mysql/arch:>chmod 755 *
test2.localdomain:mysqladmin:/usr/local/mysql/arch:>chown –R mysqladmin:dba *
database: n table,n view, n index
table

oadb oaadmin
erpdb erpdbadmin


create database ruozedb;
grant all privileges on ruozedb.* to ruoze@’%’ identified by ‘123456’;
flush privileges;

猜你喜欢

转载自blog.csdn.net/u012923827/article/details/82747336