010-LAMP_MySQL_other

来源:互联网 发布:广义逆矩阵求法 编辑:程序博客网 时间:2024/04/27 20:23

010-LAMP_MySQL_other

MySQL的user表…

MariaDB [(none)]> DESC mysql.user;+------------------------+-----------------------------------+------+-----+---------+-------+| Field                  | Type                              | Null | Key | Default | Extra |+------------------------+-----------------------------------+------+-----+---------+-------+| Host                   | char(60)                          | NO   | PRI |         |       || User                   | char(16)                          | NO   | PRI |         |       || Password               | char(41)                          | NO   |     |         |       || Select_priv            | enum('N','Y')                     | NO   |     | N       |       || Insert_priv            | enum('N','Y')                     | NO   |     | N       |       || Update_priv            | enum('N','Y')                     | NO   |     | N       |       || Delete_priv            | enum('N','Y')                     | NO   |     | N       |       || Create_priv            | enum('N','Y')                     | NO   |     | N       |       || Drop_priv              | enum('N','Y')                     | NO   |     | N       |       || Reload_priv            | enum('N','Y')                     | NO   |     | N       |       || Shutdown_priv          | enum('N','Y')                     | NO   |     | N       |       || Process_priv           | enum('N','Y')                     | NO   |     | N       |       || File_priv              | enum('N','Y')                     | NO   |     | N       |       || Grant_priv             | enum('N','Y')                     | NO   |     | N       |       || References_priv        | enum('N','Y')                     | NO   |     | N       |       || Index_priv             | enum('N','Y')                     | NO   |     | N       |       || Alter_priv             | enum('N','Y')                     | NO   |     | N       |       || Show_db_priv           | enum('N','Y')                     | NO   |     | N       |       || Super_priv             | enum('N','Y')                     | NO   |     | N       |       || Create_tmp_table_priv  | enum('N','Y')                     | NO   |     | N       |       || Lock_tables_priv       | enum('N','Y')                     | NO   |     | N       |       || Execute_priv           | enum('N','Y')                     | NO   |     | N       |       || Repl_slave_priv        | enum('N','Y')                     | NO   |     | N       |       || Repl_client_priv       | enum('N','Y')                     | NO   |     | N       |       || Create_view_priv       | enum('N','Y')                     | NO   |     | N       |       || Show_view_priv         | enum('N','Y')                     | NO   |     | N       |       || Create_routine_priv    | enum('N','Y')                     | NO   |     | N       |       || Alter_routine_priv     | enum('N','Y')                     | NO   |     | N       |       || Create_user_priv       | enum('N','Y')                     | NO   |     | N       |       || Event_priv             | enum('N','Y')                     | NO   |     | N       |       || Trigger_priv           | enum('N','Y')                     | NO   |     | N       |       || Create_tablespace_priv | enum('N','Y')                     | NO   |     | N       |       || ssl_type               | enum('','ANY','X509','SPECIFIED') | NO   |     |         |       || ssl_cipher             | blob                              | NO   |     | NULL    |       || x509_issuer            | blob                              | NO   |     | NULL    |       || x509_subject           | blob                              | NO   |     | NULL    |       || max_questions          | int(11) unsigned                  | NO   |     | 0       |       || max_updates            | int(11) unsigned                  | NO   |     | 0       |       || max_connections        | int(11) unsigned                  | NO   |     | 0       |       || max_user_connections   | int(11)                           | NO   |     | 0       |       || plugin                 | char(64)                          | NO   |     |         |       || authentication_string  | text                              | NO   |     | NULL    |       |+------------------------+-----------------------------------+------+-----+---------+-------+
MariaDB [(none)]> select Host,User,Password from mysql.user;+-----------+------+----------+| Host      | User | Password |+-----------+------+----------+| localhost | root |          || husa.hust | root |          || 127.0.0.1 | root |          || ::1       | root |          || localhost |      |          || husa.hust |      |          |+-----------+------+----------+6 rows in set (0.00 sec)

图形管理组件

授权root用户可以在所有IP端登陆

MariaDB [mysql]> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'root';Query OK, 0 rows affected (0.00 sec)MariaDB [mysql]> FLUSH PRIVILEGES;Query OK, 0 rows affected (0.00 sec)

GUI client

NavicatMysql-FrontSQLyogToadForMySQL

使用HeidiSQL远程登录数据库结果:

别说,还真不错…

phpMyAdmin

1 下载phpMyAdmin-4.0.5-all-languages.zip,并解压之

[root@husa ~]# ls99.sh            a.sh      latest.tar.gz         phpMyAdmin-4.0.5-all-languages      service.sh  wordpress-4.4.1.tar.gzanaconda-ks.cfg  grub.bak  linux-3.10.67.tar.xz  phpMyAdmin-4.0.5-all-languages.zip  show.sh

2 复制phpMyAdmin-4.0.5-all-languages目录至/var/www/html目录

[root@husa ~]# cp -r phpMyAdmin-4.0.5-all-languages /var/www/html/[root@husa ~]# ls /var/www/html/index.php.bak  phpMyAdmin-4.0.5-all-languages  wordpress

3 修改pma配置文件

[root@husa ~]# cd /var/www/html/[root@husa html]# ln -sv phpMyAdmin-4.0.5-all-languages pma"pma" -> "phpMyAdmin-4.0.5-all-languages"[root@husa html]# lsindex.php.bak  phpMyAdmin-4.0.5-all-languages  pma  wordpress[root@husa ~]# openssl rand -base64 15u9T2XpvocJvx3NyD/Yj9[root@husa pma]# pwd/var/www/html/pma[root@husa pma]# cp config.sample.inc.php config.inc.php        [root@husa pma]# vim config.inc.php # 修改下面的这个字段$cfg['blowfish_secret'] = 'u9T2XpvocJvx3NyD/Yj9'; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */

4 启动httpd

[root@husa pma]# systemctl start httpd[root@husa pma]# ss -ntlState      Recv-Q Send-Q                             Local Address:Port                               Peer Address:Port LISTEN     0      50                                             *:3306                                          *:*     LISTEN     0      128                                            *:22                                            *:*     LISTEN     0      100                                    127.0.0.1:25                                            *:*     LISTEN     0      128                                           :::80                                           :::*     LISTEN     0      128                                           :::22                                           :::*     LISTEN     0      100                                          ::1:25                                           :::*     

5 访问站点发现缺少mbstring(多字节字符串库)

6 安装之

[root@husa pma]# yum install php-mbstring

7 重启httpd再次访问,仍然不能访问!

解决办法Jerry Nettrouer II的回答:http://stackoverflow.com/questions/13357561/error-1045-cannot-log-in-to-mysql-server-phpmyadmin

8 也就是设置root用户的密码:这里不是答案中的密码,而是你自己给root设置的密码,因为一开始不知道,所以最后又一次的修改了密码,修改方法如下:即修改mysql.user表中的root用户的password字段。

MariaDB [(none)]> use mysql;Reading table information for completion of table and column namesYou can turn off this feature to get a quicker startup with -ADatabase changedMariaDB [mysql]> update user set password=password('root') where user='root';Query OK, 4 rows affected (0.05 sec)Rows matched: 5  Changed: 4  Warnings: 0MariaDB [mysql]> flush privileges;Query OK, 0 rows affected (0.00 sec)

9 再次连接结果!

出现这种现象的原因是:If you are installing first time then please try login with username and password as root。也就是首次安装mysql后要以root用户登录

0 0
原创粉丝点击