arrow_upward

Pages (2):
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
mysql-server and phpmyadmin problem
#1
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

Thanks to Post4VPS and Hostlease for their great services.  
#2
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:
mysql --user=root mysql

3. Create the new user with:
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:
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:
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.
[Image: zHHqO5Q.png]
#3
Thanks @Hidden Refuge , logging in problem has been solved but now it is showing another error.
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-ph...sql-count/

Thanks to Post4VPS and Hostlease for their great services.  
#4
What do you want to do with the mysql?
And where can I you see this warning?
#5
(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-ph...sql-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-pass...-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.
[Image: zHHqO5Q.png]
#6
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
Terminal
humanpuff69@FPAX:~$ Thanks To Shadow Hosting And Post4VPS for VPS 5
#7
(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-pass...-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?

Thanks to Post4VPS and Hostlease for their great services.  
#8
What was your PHP version again? 7.2? Try this:
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...r-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.
[Image: zHHqO5Q.png]
#9
(03-12-2019, 06:54 AM)Hidden Refuge Wrote: What was your PHP version again? 7.2? Try this:
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...r-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?

Thanks to Post4VPS and Hostlease for their great services.  
#10
(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:
mysql -u root -p

4. Create a empty database where you want to import the backup into:
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:
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.
[Image: zHHqO5Q.png]
Pages (2):


Possibly Related Threads…
Thread
Author
Replies
Views
Last Post
12,541
03-21-2019, 09:12 PM
Last Post: amontes

person_pin_circle Users browsing this thread: 2 Guest(s)
Sponsors: VirMach - Host4Fun - CubeData - Evolution-Host - HostDare - Hyper Expert - Shadow Hosting - Bladenode - Hostlease - RackNerd - ReadyDedis - Limitless Hosting