Get back the access to the database on local server - php

I've done a mistake and would be really thankful to get help.
I've been using MAMP to create a wordpress website on my computer. Today I've been trying to move in to the actual hosting and I guess I've somehow damaged the database.
The thing is that the default username and password are "root" and i wanted to change that before downloading database from the local server. I did, and after that i couldn't use phpMyAdmin, it suggested me to check config.inc.php. I went to this file and there in the code there were still default "root" username and password.
I changed them to the new ones (the same i used before) and it helped, but only to a certain extention. Now i can use phpMyAdmin, but don't have the rights neither to create a new database, nor to make any changes to the user privileges.
So the question is: how to make it all working as it was working before? :)) Thanks a lot in advance!
The second little question is:
Are there any possibilities to upload and use this messy database to the actual server? Otherwise none of the settings on my website is working and i kinda have to restart making it.

Since you can't do much from within phpMyAdmin, it sounds like you may be logged in as the anonymous user, which happens if you try to log in and don't match an existing username/host. Double-check that the username and host you're logging in as are the ones configured in MySQL. You may need to reset your account. Even though the error message is different (due to the use of the anonymous user), this may be helpful: Fix Access denied for user 'root'#'localhost' for phpMyAdmin
If your auth_type is 'cookie' or 'http' then you don't need to edit config.inc.php with your new login information (since config.inc.php shouldn't have it in at all, the user and password fields are only used with auth_type 'config'), only enter it when prompted at login.

Related

WordPress Installation Using Mamp: Error establishing a database connection

I am a beginner in WordPress. I have been doing an Udemy course, entitled "WordPress Theme Development Using Bootstrap" by Brad Hussey.
I have installed MAMP. Then I followed all the instructions of the tutorial to create a new database and a new user account via PHPMyAdmin. Then I edit the wp-config-sample.php file appropriately using the correct credentials. I copied all the codes from https://api.wordpress.org/secret-key/1.1/salt/ and paste them in the right place. Then I renamed the file to wp-config.php. Now, when I go to http://localhost/wp-admin/ in my browser, the following error appears:
Error establishing a database connection
This either means that the username and password information in your wp-config.php file is incorrect or we can't contact the database server at localhost. This could mean your host's database server is down.
Are you sure you have the correct username and password?
Are you sure that you have typed the correct hostname?
Are you sure that the database server is running?
If you're unsure what these terms mean you should probably contact your host. If you still need help you can always visit the WordPress Support Forums.
I have typed the correct username and password in the wp-config.php file. I had typed the hostname as "localhost". And MySQL server is running on MAMP. So, I have done everything correctly. But can't get rid of this frustrating issue. Please, help me. I cannot proceed further to this course without solving it.
I have already seen some of the YouTube videos explaining the same solution that I tried to follow. It worked for them, but not for me.

Issues setting up mysql database

I have a php script that (in theory) connects to a database. The issue is that when I try to test my script in http://phptester.net/ it tells me that said credentials are wrong.
I am fairly new to this whole php and mysql set up but this is what I know thus far:
I have a domain registered # godaddy.com with hosting (obviously)
I used their Database Interface to create my first database (I called it myProfile)
I also used their interface to create a user and added that user to the database with all its privileges
Here is where the issue lays:
I go to Databases link in my cPanel page and see my database WITH my user and you can see its privileges:
Now, I go to phpMyAdmin in godaddy and I find that there is indeed the myProfile database but I can't find the user I created.
I see a user that I never ever seen before but no matter what I do in phpMyAdmin I can't ADD, CREATE, GRANT PRIVILEGES or do anything user related. I even tried looking up in a query to see if the one I created on the interface shows up. But nothing works!
Can anyone help me with this conundrum?
Your host likely doesn't accept incoming connections from anywhere but 127.0.0.1. Even if it does, it shouldn't accept those requests unless they're encrypted.
Therefore, PHPTester.net fails - not by any deficiency, just because Godaddy is using default/recommended/smart security settings to disallow these remote connection attempts.
Why not try testing the database connection by opening a browser window pointed at the connection page you're showing us?
I dont really get lucas's answer but after creating a user you have to explicitely assign the user to the database.

Is there a possibility I can give a separate password to access phpmyadmin - XAMPP

I'm doing small system with PHP/MYSQL. From XAMPP security module I gave a password to access the phpmyadmin. The same password I am using in the config file of my PHP. Yesterday my boss came up with a paculiar request ( it's an order basically) :). The request is he should be able to set the password and change the password of phpmyadmin when ever he wants. Now I can give him access to XAMPP security, but if he change the password I need to change password in the config file of my php also. Or else I will get error in my PHP program. I'm just a developer, don't know much about server configurations.

Wamp Server Error #1045

I would like to know about the Wamp server #1045 error on my machine. few days back i had installed my Wamp server and it was working fine like loading PhpMyAdmin, creation of database, localhost etc. i even performed some basic practices in Php.
Later on i learnt to change the password of MySQL via MySQL CMD and i performed the same. After that when i tried to load the PhpMyAdmin again, it showed me error #1045 access denied.
I tried to perform many thing but no respite from the pains. I tried to perform some fixes in phpmyadmin/config.inc, some setting in ctrl panl- Admin tools-Services-mySql (Start and stop)..
May i know what has happened to this and how to solve this problem. Thanks for help in advance.
You are basically giving yourself the answer inside your question.
You changed the mysql password. With which you most probably mean that you changed the mysql root user password. Since phpmyadmin is a mysql GUI (graphic user interface) it is only understandable that phpmyadmin can not function anymore because you haven't told it the new password you set. Just login to phpmyadmin by using 'root' as user and the new password you set. Works?

phpmyadmin install & login headaches

So, I'm adding phpmyadmin to a new server. I don't use it, but my designers do, so this is my first run in with it. I got it up and running without any problems, but I've hit a wall when it comes to logging in to the db.
it works just fine if I set authentication to config, and enter a valid username and password in the config.inc.php file, but as this will be a somewhat open server, I need authentication to be set to cookie. It seems easy enough, but using the exact same user credentials that worked in the config file, every time I try to log in it boots me back to the login screen.
I'm using a mysql db on a remote server, but the user I'm using has the correct access, and I've tested using sequel pro and a bash shell, both connected without any issues.
I can't seem to figure out what's causing this, and I'm not getting any errors back from phppmyadmin.
The server it's on is running php 3.5, and the server it is connecting to is running mysql 5.1, in case that helps.
I understand you are trying to connect to a server different from the one that hosts phpMyAdmin, right?
Looking at the documentation about authentication I see a posible thing to check when using cookie method:
If you want to log in to arbitrary
server see
$cfg['AllowArbitraryServer']
directive.
So, althought it doesn't say so explicity, I understand you need to set that parameter in this case.
When you use "config" authentication type, the user's "username" and "password" are the ones you have chosen in the config file.
When using "cookie" authentication type, phpMyAdmin asks for mysql users, so when logging in to a specific database schema, you should log in in phpMyAdmin with a username/password which has privileges on that db in mysql.
In config.inc.php don't forget to put some random string in $cfg['blowfish_secret'] if you intend to use cookie authentication.

Categories