I keep getting the following errors with mysql connection through XAMPP and I don”t know what to do:
That”s the code in the config.inc.php
I”ve already reset the password from MySql from the command line two times and added the changes to this code above and to the php.ini file, but at each time it goes back to the error. Any help?
yo need create the web1_user “pma” in mysql or change this lines(web1_user and password for mysql):
/* User for advanced features */$cfg<"Servers"><$i><"controlweb1_user"> = “pma”; $cfg<"Servers"><$i><"controlpass"> = “”;Linux: /etc/phpmyadmin/config.inc.php
Add this line to the file xamppphpMyAdminconfig.inc:
$cfg<"Servers"><$i><"port"> = “3307”;Here, my port is 3307, you can change it to yours.
Đang xem: How To Solve Error #1045 In Php Myadmin
In terminal, log into MySQL as root. You may have created a root password when you installed MySQL for the first time or the password could be blank, in which case you can just press ENTER when prompted for a password.
sudo mysql -p -u rootNow add a new MySQL web1_user with the web1_username of your choice. In this example we are calling it pmaweb1_user (for phpmyadmin web1_user). Make sure to replace password_here with your own. You can generate a password here. The % symbol here tells MySQL to allow this web1_user to log in from anywhere remotely. If you wanted heightened security, you could replace this with an IP address.
CREATE USER “pmaweb1_user”
“%” IDENTIFIED BY “password_here”;Now we will grant superweb1_user privilege to our new web1_user.
GRANT ALL PRIVILEGES ON *.* TO “pmaweb1_user”
“%” WITH GRANT OPTION;Then go to config.inc.php ( in ubuntu, /etc/phpmyadmin/config.inc.php )
/* User for advanced features */
$cfg<"Servers"><$i><"controlweb1_user"> = “pmaweb1_user”; $cfg<"Servers"><$i><"controlpass"> = “password_here”;
Share
Improve this answer
Follow
answered Jan 14 “19 at 6:03
KashmiriKashmiri
87988 silver badges1313 bronze badges
1
Add a comment |
14
Add these lines to the file xamppphpMyAdminconfig.inc:
$cfg<"Servers"><$i><"controlweb1_user"> = “root”; $cfg<"Servers"><$i><"controlpass"> = “”;
Share
Improve this answer
Follow
edited Aug 12 “19 at 22:57
zx485
24.2k2626 gold badges4545 silver badges5353 bronze badges
answered Aug 12 “19 at 22:38
taufiktaufik
17911 silver badge88 bronze badges
Add a comment |
8
My default 3306 port was in use, so Ive changed it to 8111, then I had this error. Ive fixed it by adding
$cfg<"Servers"><$i><"port"> = “8111”;into config.inc.php . If you are using different port number then set yours.
Share
Improve this answer
Follow
edited Apr 17 “20 at 12:19
Dharman
21.9k1818 gold badges5757 silver badges107107 bronze badges
answered Aug 28 “19 at 5:43
A. AskarovA. Askarov
36744 silver badges88 bronze badges
0
Add a comment |
5
Linux / Ubuntu:If installed phpmyadmin via apt:sudo apt-get install phpmyadmin php-mbstring
Can check /etc/phpmyadmin/config-db.php for changing the web1_user credentials.
$dbweb1_user=”pma”;$dbpass=”my_pass”;$basepath=””;$dbname=”phpmyadmin”;$dbserver=”localhost”;$dbport=”3306″;$dbtype=”mysql”;
Share
Improve this answer
Follow
answered Aug 13 “19 at 16:50
User ReboUser Rebo
6591010 silver badges1717 bronze badges
Add a comment |
4
The Connection for controlweb1_user as defined in your configuration failed, right after:
$cfg<"Servers"><$i><"controlweb1_user"> = “pma”;$cfg<"Servers"><$i><"controlpass"> = “you_password”;
Share
Improve this answer
Follow
edited Aug 31 “19 at 9:15
El.Hum
1,59533 gold badges1111 silver badges2121 bronze badges
answered Aug 31 “19 at 5:52
Saurabh NaikeleSaurabh Naikele
5122 bronze badges
Add a comment |
4
I solved the problem by adding the line skip-grant-tables to the my.ini:
# The MySQL server
Share
Improve this answer
Follow
edited Apr 18 “20 at 14:01
answered Apr 15 “20 at 15:30
NiklasNiklas
15877 bronze badges
Add a comment |
2
I experienced the same errors on a fresh install of VestaCP. I solved the issues by following the instructions on this video.
Restart Apache, NGINX and MySQL servers.That”s it!
Share
Improve this answer
Follow
answered Nov 7 “18 at 23:30
nicozicanicozica
40366 silver badges1616 bronze badges
Add a comment |
2
Might be late to the party – also, this answer is for LAMP web1_users who got to this thread from google, like me.
Basically, the problem is PMA is trying to connect to SQL with a web1_user that doesn”t exist.
At /etc/phpmyadmin/config-db.php, you will find 2 variables: $dbweb1_user, and $dbpass.Those specify the MySQL web1_user and Password that PMA is trying to connect with.
Now, connect with some web1_username/password that work (or just “root” if you are connecting from localhost), create a new web1_user with global priviliges (e.g – %PMA User% with password %Some Random Password%), then in the above mentioned file set:$dbweb1_user = %PMA User% ;$dbpass = %Some Random Password%;
You might also change other stuff there, like the server address ($dbserver), the port ($dbport, which might not be the default one on your machine), and more.
Share
Improve this answer
Follow
answered Feb 27 “19 at 12:26
ron wizzleron wizzle
3966 bronze badges
Add a comment |
2
I just finished web1_setting up my XAMPP on the MAC and had the same trouble. I just fixed it. It is not quite clear what OS you”re using but you need to run the XAMPP security. You indicate you”ve done that, but here it is anyway for the MAC
sudo /Applications/XAMPP/xamppfiles/xampp security Set your password on the questions you get.
Xem thêm: Cách Chạy Quảng Cáo Google Adwords Hiệu Quả, Hướng Dẫn Tự Chạy Quảng Cáo Google Adwords
In you”re phpmyadmin import the “create_tables.sql” .. Which can be found in the ./phpmyadmin/sql folder.
Next open the config.inc.php file inside the ./phpmyadmin folder.
$cfg<"Servers"><$i><"controlweb1_user"> = “pma”;$cfg<"Servers"><$i><"controlpass"> = “you_password”;Make sure to log out and log in to reflect the changes within phpmyadmin
Share
Improve this answer
Follow
edited Apr 7 “19 at 15:38
Tito Amoo
29322 silver badges1414 bronze badges
answered Apr 10 “18 at 18:58
DanielDaniel
4,36522 gold badges2424 silver badges3030 bronze badges
Add a comment |
2
I changed in file config.inc.php
$cfg<"Servers"><$i><"host"> = “127.0.0.1”;to
$cfg<"Servers"><$i><"host"> = “localhost”;and it worked!
Share
Improve this answer
Follow
answered May 30 at 6:43
community wiki
Sumit Waghmare
Add a comment |
1
consider changing host entry 127.0.0.1 to localhost or even the IP address of the server.
$cfg<"Servers"><$i><"host">
Share
Improve this answer
Follow
edited Jul 3 “18 at 12:51
Hassaan
6,35555 gold badges2525 silver badges4444 bronze badges
answered Dec 21 “17 at 2:48
TheSatinKnightTheSatinKnight
55455 silver badges1111 bronze badges
Add a comment |
1
if your port is 3307 (based on your port)
Add this line in xamppphpMyAdminconfig.inc: after i++
$cfg<"Servers"><$i><"port"> = “3307”;
Share
Improve this answer
Follow
answered Aug 30 “19 at 19:15
JIDULAL V MJIDULAL V M
1922 bronze badges
Add a comment |
1
This error is caused by a line of code in /usr/share/phpmyadmin/libraries/sql.lib.php.
It seems when I installed phpMyAdmin using apt, the version in the repository (phpMyAdmin v4.6.6) is not fully compatible with PHP 7.2. There is a newer version available on the official website (v4.8 as of writing), which fixes these compatibility issues with PHP 7.2.
You can download the latest version and install it manually or wait for the repositories to update with the newer version.
Alternatively, you can make a small change to sql.lib.php to fix the error.
Xem thêm: Cách Khá Đơn Giản Để Tích Hợp Bảo Kim Vào WordPress Sử Dụng, Tích Hợp Cổng Thanh Toán Bảo Kim
Firstly, backup sql.lib.php before editing.
1-interminal:
sudo cp /usr/share/phpmyadmin/libraries/sql.lib.php /usr/share/phpmyadmin/libraries/sql.lib.php.bak2-Edit sql.lib.php. Using vi:
sudo vi /usr/share/phpmyadmin/libraries/sql.lib.phpOR Using nano:
sudo nano /usr/share/phpmyadmin/libraries/sql.lib.phpPress CTRL + W (for nano) or ? (for vi/vim) and search for (count($analyzed_sql_results<"select_expr"> == 1)
Replace it with ((count($analyzed_sql_results<"select_expr">) == 1)
Save file and exit. (Press CTRL + X, press Y and then press ENTER for nano web1_users / (for vi/vim) hit ESC then type :wq and press ENTER)
Related posts
Mua Tên Miền .Vn – Tên Miền Uy Tín Tại Việt Nam
Gia hạn: 450.000 đ | Đăng ký: 750.000 đ/Năm Tặng tên miền .online: VNFRONL Tên miền .VN lưu trữ...
Cách Chuyển Website WordPress Sang Host Mới ? Cách Chuyển Host WordPress Sang Host Mới
Trong quá trình quản lý hoạt động của một website, bạn khó tránh khỏi tình huống phải chuyển sang...
Domains Là Gì ? Từ A Đến Z Về Domain Từ A Đến Z Về Domain
Domain là gì? Tôi nên lựa chọn domain theo tiêu chí nào? Tên miền Việt Nam hay quốc tế...
Hướng Dẫn Ghost Bằng Win Mini Xp, Hướng Dẫn Ghost, Tạo File Ghost, Cài Win
Hiện nay cách cài win trên WinPE là phương pháp tối ưu nhất có thể giúp bạn hạn chế các...
Hướng Dẫn Ghost Win Bằng Onekey Tốc Độ Cao, Cách Ghost Win 7 Bằng Onekey Tốc Độ Cao
Với những người không thực sự am hiểu về công nghệ và máy tính, thì việc phải cài lại...
How To Fix Err_Connection_Refused Error In Chrome &Raquo; Webnots
In a digital world hooked on instant gratification, one of the last things you want to experience when browsing...