MySQL information_schema.tables is not creating new entries - php

I have a simple Droplet setup in Digital Ocean and I installed MySQL in it. I also installed PhpMyAdmin for UI control of the databases.
My problem is when I try to import/create Database through PhpMyAdmin or using script (php), the information_schema.tables does not create new entries of the currently imported/created database.

Check your user privileges by witch you are connecting phpmyadmin or your php script, manage that user permissions and add privilege for creating database.

Related

cant connect opencart to mySQL database

I'm trying to set up opencart for my website, but when I fill in everything for the MySQL database I get this error:
No connection could be made because the target machine actively refused it.
I've tried putting it on localhost, I've tried on 127.0.0.1. when I try on 192.168.1.126 (the database server) it says it can't find the database
the server hosting the PHP site is on 192.168.1.125
I'm very new to SQL, I really don't understand it fully. I'm creating a new database in SQL workbench. and filling in the info I need. How to I fix this error?
My guess is that your DB user is only allowed to access the DB server from 127.0.0.1. You might want to grant additional privileges to it and in your SQL shell run something like
GRANT ALL PRIVILEGES ON *.* To 'your-db-user'#'192.168.1.125'

phpBB and mySQL "Could not connect to the database..."

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!

phpMyAdmin and mysql not showing the same database

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

MySQL not showing databases created in phpMyAdmin

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.

Importing MySql Database to online web hosting site?

I'm doing this website and I first tested it locally. Everything works including the database. The form from the html automatically sends submitted data to my database. The problem is, I want to host it online. I already have the website. I use webfreehosting.net. How can I insert my database to the file manager? I checked out the mysql manager and it says it imports text files. But the database folder on my local disk has opt and frm files only.
It looks like you are just starting out with web development. There are better, safer and faster ways to take MySQL dumps, but I would suggest you start with a graphical interface that aids in learning.
Your hosting provider would have provided you with a control panel. On their website, I can see that they provide phpMyAdmin. To import your database, you need to take the following steps:
Download a desktop MySQL administrator like MySQL Workbench
Export your database to a .SQL file
Log in to your web hosting control panel.
Create a Database.
Create a Database user and set a password for this
Grant this user all permissions to your database (not advisable, but its okay to start with)
Find phpMyAdmin. You will see this database listed.
Click on import and Import the database .sql file you created in step 2
Take a backup of your development database using mysqldump, then run the generated SQL against your production system.
Export your local database from MySQL Workbench in SQL format (text files). Then, import the same into online database using PHPMyAdmin.
How can I insert my database to the file manager?
You do not. If you made the website, you should know that you did not use it. Use phpMyAdmin for SQL.
Also, if you application is not working then check if you have made configuration changes in the file, like username, password.

Categories