I'm trying to build a database for my server in phpmyadmin but when I finish building it I can't access it using PHP and it won't show when I list the databases in MySQL. But when I create a database in mySql it shows up in phpmyadmin. Also I'm running phpmyadmin version 4.0.3, and theres a statement at the bottom of the page saying The phpMyAdmin configuration storage is not completely configured, some extended features have been deactivated. To find out why click here.
Thanks!
I just had the problem, and realized that I was creating database with names with '_test' suffixes.
It happens that phpmyadmin has a feature to hide some DBs. To change that behaviour, you can navigate to : settings > features > general > Hide databases
By default, hiddent databases have these patterns : information_schema|mysql|performance_schema|test|phpmyadmin
If you Still don't see it, Try to logout and then log in again to cPanel or PHPMyAdmin. It worked for me.
This sounds like a permissions issue. I'd guess that your phpMyAdmin is connecting to MySQL as root (or another user with the superuser privilege) and can therefore see all databases. Your app is probably connected using a different, lower privileged user.
Try running select user(); from your app and from phpMyAdmin and you will know for sure.
Assuming your app is running with a different user, you will need to add privilages for it to access the database you create. Please read the section titled Assigning privileges to user for a specific database in the phpMyAdmin documentation.
This is pure permission issue.
If you logged in without specifying the user, you won't see all the databases just like #t3po7re5 mentioned. What you should do is specify root user in your command.
mysql -uroot -p
It will prompt you to then enter the password. this is the default password if you have not specified or changed the default root password depending on the local server you are using.
Related
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.
I have created MySQL database using cpanel and created required tables, stored procedures in it from phpmyadmin.
After creating, at the end as usual I logged out from both cpanel and phpmyadmin too.
Next day I logged in to cPanel and then opened phpmyadmin, what I found is list of all the stored procedures is there; but there definitions is not there. And even "Edit" & "Execute" options were also disabled.
I am using VPS from well known hosting company.
I have never faced this type of problem from any other hosting company.
I also given proper privileges to database user. But still not able sort out this problem.
Is it something my fault or is it some sort of setting which we have to set from WHM panel or cPanel?
Thanks in advance.
After some R&D, I found that whatever users are being created through cPanel, they don't have super privileges. And hence they can create stored procedures but once they log out they wont be able to edit them. This is what by default settings done by hosting company.
I am trying to set up a phpBB forum on a locally hosted webpage. It being done in an openSUSE Linux OS.
I have installed MariaDB (MySQL), and created a new database named new_database using the command CREATE DATABASE new_database;, along with a user named user with the command CREATE USER 'new_user'#'localhost' IDENTIFIED BY 'password';. I also changed the root password to password, just for testing purposes.
When I enter this info into the phpBB installation database settings screen, I get the error
Could not connect to the database, see error message below.
Access denied for user 'new_user'#'localhost' to database 'new_database'.
I am using localhost for the DSN. Any ideas? From everything I've found online it should be working...
After you create the user you have to Grant Privileges, this is how you do it.
GRANT ALL PRIVILEGES ON new_database.* TO 'newuser'#'localhost';
Do not forget to flush.
FLUSH PRIVILEGES
Common Privileges
ALL PRIVILEGES- all access
CREATE- allows them to create new tables or databases
DROP- allows them to them to delete tables or databases
DELETE- allows them to delete rows from tables
INSERT- allows them to insert rows into tables
SELECT- allows them to use the Select command to read through databases
UPDATE- allow them to update table rows
GRANT OPTION- allows them to grant or remove other users' privileges
You can specify the database and table.
new_database.* (Specific Database, all tables)
new_database.table (Specific Database, specific table)
*.* (all databases, al tables)
I had the same issue with a phpBB install and solved the problem by accessing the database through phpMyAdmin and noticing on the splash page it said "User: pits#localhost", which was different from the user (pits_bull) I had created and attached to the database and was trying to connect with.
I tried it with just "pits" and it worked. Not sure whether there is a security issue with that though, or why it worked, but it IS working!
I have setup WAMP which I managed by using a tutorial and everything seems fine... I am logging into mysql as the root user with full privileges granted and I am able to create databases in mysql and view them by using SHOW DATABASES; so far so good !
...However...
When I access phpMyAdmin and go to the databases section, there are no databases which I have created in mysql, even though phpMyAdmin shows the Database server as User:root#localhost which is the same user I am accessing mysql with.
This situation is also the same when reversed, I can create a database as the root user in phpMyAdmin but the database will not show in mysql when I am logged in as root user and use SHOW DATABASES;
i have tried every soution available ONLINE ..
most of them saying about
$cfg['Servers'][$i]['hide_db'] = '';
i have done that too ....
but nothing seems to work....
plzzzz help
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.