Post4VPS Forum | Free VPS Provider
mysql-server and phpmyadmin problem - Printable Version

+- Post4VPS Forum | Free VPS Provider (https://post4vps.com)
+-- Forum: Geek World (https://post4vps.com/Forum-Geek-World)
+--- Forum: Scripting & Programming (https://post4vps.com/Forum-Scripting-Programming)
+--- Thread: mysql-server and phpmyadmin problem (/Thread-mysql-server-and-phpmyadmin-problem)

Pages: 1 2


mysql-server and phpmyadmin problem - Rehan - 03-08-2019

Hello Experts, I am having problem in installing mysql-server and phpmyadmin.I have install mysql-server on Ubuntu with command ( apt-get install mysql-server ) with root.Installation was done without asking for a password ( as it was before ).Then i installed phpmyadmin and entered password.Now whenever i try to login with that passowrd it shows " [Image: dot.gif] mysqli_real_connect(): (HY000/1698): Access denied for user 'root'@'localhost' "


https://i.imgur.com/Va60JVh.jpg



I searched at google and found a information that mysql server is not working with root user anymore so i have created another user and re-installed the phpmyadmin and mysql server but still shows same error if i login with root username and if i login with the new user it shows.

https://i.imgur.com/l7VjmXt.jpg


RE: mysql-server and phpmyadmin problem - Mashiro - 03-08-2019

Quite simple: for security purpose root login from anywhere else other than the localhost command line has been disable for the root user in the newer MySQL/MariaDB versions starting from version 5.7 (I think or maybe even from 5.6 already).

You need to create a seperate new user and grant it permission to the whole system if you want a "root like" user that you can use in phpMyAdmin.

1. Login into your VPS via SSH as root.

2. Run this command to start the MySQL command line as MySQl root in the main mysql database:
Code:
mysql --user=root mysql

3. Create the new user with:
Code:
CREATE USER 'desiredusername'@'localhost' IDENTIFIED BY 'yourpassword';
(Remember to replace "desiredusername" and "yourpassword" with the corresponding username and password you want to use for it.)

4. Grant the user full permission to the MySQl system and databases:
Code:
GRANT ALL PRIVILEGES ON *.* TO 'desiredusername'@'localhost' WITH GRANT OPTION;
(Remember to replace "desiredusername" with the corresponding username from step 3.)

5. Reload the MySQl permissions to apply changes:
Code:
FLUSH PRIVILEGES;

6. Exit MySQL command line with a simple "exit".

Make sure you phpMyAdmin listens to MySQL on localhost.


Try to login with the new user now. That should be it already. Works for me. I use Maria DB 10.1 on Debian 9 with PHP 7.3 and after running this commands I was able to create a root like user that I can use in phpMyAdmin for SQL administration.


RE: mysql-server and phpmyadmin problem - Rehan - 03-08-2019

Thanks @Hidden Refuge , logging in problem has been solved but now it is showing another error.
Code:
Warning in ./libraries/plugin_interface.lib.php#551
count(): Parameter must be an array or an object that implements Countable

Backtrace

./libraries/display_import.lib.php#371: PMA_pluginGetOptions(
string 'Import',
array,
)
./libraries/display_import.lib.php#456: PMA_getHtmlForImportOptionsFormat(array)
./libraries/display_import.lib.php#691: PMA_getHtmlForImport(
string '5c8297aa41850',
string 'server',
string '',
string '',
integer 2097152,
array,
NULL,
NULL,
string '',
)
./server_import.php#34: PMA_getImportDisplay(
string 'server',
string '',
string '',
integer 2097152,
)

On searching on google I found a method.i have tried replacing that line but still showing error.

https://devanswers.co/problem-php-7-2-phpmyadmin-warning-in-librariessql-count/


RE: mysql-server and phpmyadmin problem - youssefbasha - 03-08-2019

What do you want to do with the mysql?
And where can I you see this warning?


RE: mysql-server and phpmyadmin problem - Mashiro - 03-08-2019

(03-08-2019, 04:31 PM)Rehan Wrote: Thanks @Hidden Refuge , logging in problem has been solved but now it is showing another error.

On searching on google I found a method.i have tried replacing that line but still showing error.

https://devanswers.co/problem-php-7-2-phpmyadmin-warning-in-librariessql-count/


You installed phpMyAdmin through the package manager of your Linux distribution?

If so. That might be the issue. It most likely is a version that is older and doesn't work with latest PHP 7.2/7.3.

Eitherway phpMyAdmin is a unzip, configure and use application. So you should uninstall the one you installed through the package manager. Download a copy of the latest version from their website, unzip it, move the folder to the web folder where you host your site, rename config.sample.inc.php to config.inc.php and open the file to edit the blowfish secret for the authentication cookie. After that it should work. I use the latest PMA with Nginx mainline, PHP 7.3 and MariaDB 10.1.

phpMyAdmin Installation on any webserver/Linux OS: https://freevps.us/thread-4288.html (you only need step 1 to 6)

For the blowfish secret I recommend this site: http://www.passwordtool.hu/blowfish-password-hash-generator

It is quite easy. I don't understand why people install outdated versions with package managers... It's so pointless. It's a web application like Wordpress and etc. You are supposed to always install the latest version yourself within a few steps.


RE: mysql-server and phpmyadmin problem - humanpuff69 - 03-09-2019

newer version of mysql only allow root login on root user that mean you can only use root user if you run mysql command on root . to fix it just add a password to the account i forget which it is but it look like the method that is mentioned above . after that you can login as root in mysql . i encounter this when i install mysql on ubuntu 18.04 to found out it use the new version that cannot login to root . i spent lot of time reading some stack overflow and finally found the solution


RE: mysql-server and phpmyadmin problem - Rehan - 03-12-2019

(03-08-2019, 05:24 PM)Hidden Refuge Wrote: You installed phpMyAdmin through the package manager of your Linux distribution?

If so. That might be the issue. It most likely is a version that is older and doesn't work with latest PHP 7.2/7.3.

Eitherway phpMyAdmin is a unzip, configure and use application. So you should uninstall the one you installed through the package manager. Download a copy of the latest version from their website, unzip it, move the folder to the web folder where you host your site, rename config.sample.inc.php to config.inc.php and open the file to edit the blowfish secret for the authentication cookie. After that it should work. I use the latest PMA with Nginx mainline, PHP 7.3 and MariaDB 10.1.

phpMyAdmin Installation on any webserver/Linux OS: https://freevps.us/thread-4288.html (you only need step 1 to 6)

For the blowfish secret I recommend this site: http://www.passwordtool.hu/blowfish-password-hash-generator

It is quite easy. I don't understand why people install outdated versions with package managers... It's so pointless. It's a web application like Wordpress and etc. You are supposed to always install the latest version yourself within a few steps.

I tried that method.It shows that mbsrting missing.Also i am unable to install extensions libapache mcrypt.
What is disturbing php version or phpmyadmin ? What if i use a previous version?


RE: mysql-server and phpmyadmin problem - Mashiro - 03-12-2019

What was your PHP version again? 7.2? Try this:
Code:
apt-get install php7.2-mbstring

mcrypt is deprecated since PHP 7.1 and later. It no longer has its own package and is included in a different software. I use PHP 7.3 with the latest phpMyAdmin, mbstring and have no issues regarding mcrypt.

If you still need mcrypt going try this: https://www.techrepublic.com/article/how-to-install-mcrypt-for-php-7-2/


What the problem first was: you used a pretty new PHP version together with old phpMyAdmin that isn't compatible with PHP 7.2/7.3. So you needed to use the latest phpmyAdmin.


RE: mysql-server and phpmyadmin problem - Rehan - 03-12-2019

(03-12-2019, 06:54 AM)Hidden Refuge Wrote: What was your PHP version again? 7.2? Try this:
Code:
apt-get install php7.2-mbstring

mcrypt is deprecated since PHP 7.1 and later. It no longer has its own package and is included in a different software. I use PHP 7.3 with the latest phpMyAdmin, mbstring and have no issues regarding mcrypt.

If you still need mcrypt going try this: https://www.techrepublic.com/article/how-to-install-mcrypt-for-php-7-2/


What the problem first was: you used a pretty new PHP version together with old phpMyAdmin that isn't compatible with PHP 7.2/7.3. So you needed to use the latest phpmyAdmin.

Alright! i am unable to manage phpmyadmin.I shall try fixing this in free time but for now i want to import database from my Windows system to ubuntu server via terminal is it possible?


RE: mysql-server and phpmyadmin problem - Mashiro - 03-12-2019

(03-12-2019, 08:31 AM)Rehan Wrote: for now i want to import database from my Windows system to ubuntu server via terminal is it possible?

That is certainly possible.

1. Backup the database on your Windows server into the .sql format (you can also compress it if you like).

2. Transfer the .sql file to your Linux server (extract it if you compressed it).

3. Start the MySQL command line and login as root:
Code:
mysql -u root -p

4. Create a empty database where you want to import the backup into:
Code:
CREATE DATABASE databasenamehere;
(Replace "databasenamehere" with your desired database name.)

5. Exit the MySQL command line with a simple "exit" command.

6. Import the database backup into the new empty database:
Code:
mysql -u root -p databasenamehere < databasebackupfile.sql
(Again remember to adjust database name and the database backup file name.)

7. Wait until the import is complete.


That's it actually. Works on MySQL and MariaDB.