Lỗi cài đặt phpMyAdmin

Khi mySQL/Mariadb có mật khẩu root thì phpmyadmin không thể tạo CSDL phpmyadmin vì mặc định nó xem như root không có mật khẩu.

Error
MySQL said:
#1045 – Access denied for user ‘root’@’localhost’ (using password: NO)
phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in your configuration and make sure that they correspond to the information given by the administrator of the MySQL server.

Giải pháp đơn giản là tạm thời bỏ mật khẩu root, cài phpmyadmin rồi đặt lại mật khẩu root

sudo su
mysqladmin -uroot -p'your_root_password' password ''
apt install phpmyadmin
mysqladmin -uroot -p'' password'your_root_password'

Tuy nhiên cài đặt xong, mở database có thể gặp lỗi

Warning in ./libraries/sql.lib.php#613
count(): Parameter must be an array or an object that implements Countable

Ta sửa giá trị tham số thành object như phpmyadmin cần

nano /usr/share/phpmyadmin/libraries/sql.lib.php

Dùng ctrl + w để tìm

count($analyzed_sql_results['select_expr'])
và bọc thêm cho nó cặp ngoặc
(count($analyzed_sql_results['select_expr']))

ctrl + x, y để lưu file.

Comments Off on Lỗi cài đặt phpMyAdmin

Filed under Software

Comments are closed.