Instalei o nginx
no Raspberry Pi executando o Raspbian Stretch e instalei o Wordpress
No processo eu corri o seguinte
sudo apt install mysql-server
sudo apt install php-mysql
Eu configuro o MariaDB e configuro o banco de dados do WordPress com
sudo mysql_secure_installation
sudo mysql -uroot -p
create database wordpress;
GRANT ALL PRIVILEGES ON wordpress.* TO 'root'@'localhost' IDENTIFIED BY 'redacted';
Eu fiz algumas configurações do WordPress e queria fazer backup do meu WordPress
Eu tentei instalar o phpmyadmin
( sudo apt install phpmyadmin
), mas isso continua falhando com o erro ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
Parece não haver nenhuma opção para digitar a senha para root @ localhost
Eu tentei interrogar MariaDB
, o que mostra: -
MariaDB [(none)]> status
--------------
mysql Ver 15.1 Distrib 10.1.23-MariaDB, for debian-linux-gnueabihf (armv7l) using readline 5.2
Connection id: 104
Current database:
Current user: root@localhost
SSL: Not in use
Current pager: stdout
Using outfile: ''
Using delimiter: ;
Server: MariaDB
Server version: 10.1.23-MariaDB-9+deb9u1 Raspbian 9.0
Protocol version: 10
Connection: Localhost via UNIX socket
Server characterset: utf8mb4
Db characterset: utf8mb4
Client characterset: utf8mb4
Conn. characterset: utf8mb4
UNIX socket: /var/run/mysqld/mysqld.sock
Uptime: 18 hours 43 min 19 sec
MariaDB [(none)]> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| wordpress |
+--------------------+
Portanto, nenhum banco de dados phpmyadmin
parece ter sido criado.
Alguém pode me ajudar a instalar o phpmyadmin
?
Criaria manualmente a ajuda do phpmyadmin do banco de dados?
EDITAR
Com base na resposta do @Kramer, este parecia ser um problema conhecido do Debian (pensei que os pacotes Debian deveriam ser verificados).
Agora realizei as seguintes etapas (os locais dos arquivos foram diferentes dos sugeridos)
cd /usr/share/phpmyadmin/sql/
create database phpmyadmin;
mysql -u root -p < create_tables.sql
create database phpmyadmin;
grant all privileges on phpmyadmin.* to phpmyadmin@localhost identified by "redacted";
Grant USAGE ON mysql.* TO phpmyadmin@localhost;
GRANT SELECT ON mysql.db TO phpmyadmin@localhost;
GRANT SELECT (Host, Db, User, Table_name, Table_priv, Column_priv) ON mysql.tables_priv TO phpmyadmin@localhost;
GRANT SELECT (Host, User, Select_priv, Insert_priv, Update_priv, Delete_priv, Create_priv, Drop_priv, Reload_priv, Shutdown_priv, Process_priv, File_priv, Grant_priv, References_priv, Index_priv, Alter_priv, Show_db_priv, Super_priv, Create_tmp_table_priv, Lock_tables_priv, Execute_priv, Repl_slave_priv, Repl_client_priv) ON mysql.user TO phpmyadmin@localhost;
GRANT SELECT, INSERT, UPDATE, DELETE ON phpmyadmin.* TO phpmyadmin@localhost;
Eu configurei nginx
adicionando o seguinte a /etc/nginx/sites-available/default
conforme link
location /phpmyadmin {
root /usr/share/;
index index.php;
try_files $uri $uri/ =404;
location ~ ^/phpmyadmin/(doc|sql|setup)/ {
deny all;
}
location ~ /phpmyadmin/(.+\.php)$ {
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
include snippets/fastcgi-php.conf;
}
}
Navegar para your-domain.com/phpmyadmin/
e fazer login como phpmyadmin
mostrou phpMyAdmin .
Pensei em sucesso !, no entanto, ao navegar para Databases
, recebi os seguintes erros: -
mysqli_real_connect(): (HY000/1045): Access denied for user 'root'@'localhost' (using password: YES)
Connection for controluser as defined in your configuration failed.
Parece que a tentativa anterior havia criado / modificado arquivos em /etc/phpmyadmin/
, que está tentando usar a senha ausente (conforme o log de instalação)
Creating config file /etc/phpmyadmin/config-db.php with new version
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO).
unable to connect to mysql server.
error encountered creating user:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
dbconfig-common: phpmyadmin configure: trying again.
Determining localhost credentials from /etc/mysql/debian.cnf: succeeded.
dbconfig-common: writing config to /etc/dbconfig-common/phpmyadmin.conf
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO).
unable to connect to mysql server.
error encountered creating user:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
dbconfig-common: phpmyadmin configure: trying again.
Determining localhost credentials from /etc/mysql/debian.cnf: succeeded.
dbconfig-common: writing config to /etc/dbconfig-common/phpmyadmin.conf
Replacing config file /etc/dbconfig-common/phpmyadmin.conf with new version
Replacing config file /etc/phpmyadmin/config-db.php with new version
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO).
unable to connect to mysql server.
error encountered creating user:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)