Information-schema vs mysqli.db

Tried to use my database but Igot a message showing that the information_schema rejected access. Investigation revealed that my site is using a mysql.db or close to that rather than the info schema.
Tested a couple of times after the mysql.db showed up but I got the same message each time. I then tried several times to alter the info schema to no avail. I don’t know what we are supposed to do with the two files. Is there a way to update info schema with mysql.db? Suggestions anyone?

@fordsfolley [quote=“fordsfolley, post:1, topic:77288”]
Is there a way to update info schema with mysql.db?
[/quote]
No.

Can you tell, what are you trying to do??
Also post screenshot of the error you’re getting??

Hi @fordsfolley!

Sounds like you are trying to do something which requires root access to your database. This is not allowed by 000webhost. If you want a database with root access you should consider buying a VPS:

Notice: Undefined index: district in /storage/ssd1/872/1783872/public_html/mbrproc.php on line 9
Connected successfullyProblem in recording your member data. Please try again later. Access denied for user ‘id1783872_mbrlee’@’%’ to database ‘information_schema’

Basically trying to run my website, in this case trying to insert form data into database. The error message points to the informational_schema at the privileges,(insert, select, etc,). Somewhere in my investigation it said that this was supposed to be ??? in the mysql database which shows all privileges granted. The info schema db grants none.

I don’t know how I should proceed.

You can’t perform INSERT, UPDATE, or DELETE commands on information_schema database. The content of it is read-only.

As said above, To use INSERT, UPDATE, or DELETE, first click on particular database(instead of information_schema), then execute.

I wasn’t trying to insert, update, or delete on any database other than my database named mbr in my php script. I have a website which is trying to do a mysqli_query sql input data from form inserted into my mbr database. The problem is that my INSERT into mbr fails with the message I sent to Akhilkuma 332. The message comes from a file called information_skema which I believe is part of phpadmin. It’s message indicates that info_scheme has all permissions set to know, where as the mysql db has all permissions set to yes which would allow any of the sql actions (insert, update, delete, etc.)

Please try again later. Access denied for user ‘id1783872_mbrlee’@’%’ to database ‘information_schema’

If it states this it means something in your scrip attempted to access 'information_schema'.

Maybe you have not selected the database on which you want to perform the query? (mysqli_select_db())

I think that I can now describe the problem I am having. I have seen some related forum questions. The problem as I see it is that our permissions are in a file, mysql, table db. This appeared in the left hand column of the phpmyadmin program (or whatever you call it). It is supposed to either replace the information_schema, or supplement it. Our permissions are all set to no in the schema and all but GRANT are set to yes in the mysql db table.

I haven’t compared all of the contents of the schema to the mysql db. I believe our web host needs to modify the cfg or .htaccess file(s) to either modify the schema or replace it with the mysql db.
I don’t have the technical expertise to fix it.

We have configured the database specifically for shared and free hosting. However I don’t know what is that has to do with your problem :confused:

Something in your script attempts to perform queries on information_schema. The content of this database is by default, on any MySQL system, read-only. One cause would be that the script requires root access over the database (in which case you should buy a paid plan or better: a VPS).

This is why I am saying again: make sure in your script the database on which you are performing queries is selected properly…

There is only one data base in my script. That error message shows the schema db as it is trying to get my permissions to input the data from the html form. I used this php script when my website was on godaddy and it worked fine. The problem is that the schema has no permissions yes where the mysql db has all permissions except GRANT set as yes. I need to know how to use this mysql.db file//table rather than the schema file.

I have modified the code. Does it work now?

What code did you modify? Do I have to do anything with my scripts or html to take advantage of the change? I ran it without any changes and it still wouldn’t allow the insert sql. I repeat that I have nothing pointing at informational_schema. All I have is one database which is the idnnnnnnnn_mbr.

This is the code in my scripts which is where the problem is.

$_SESSION[“id”] = mysqli_insert_id($conn);

$host = “localhost”;
$user = “id1234567_xxxlee”;
$db = “id1234567_xxx”;
$pass = "password$host = “localhost”;
$user = “id1783872_mbrlee”;
$db = “id1783872_mbr”;
$pass = “mbrX195877”;

// Create connection
$conn = mysqli_connect($host, $user, $pass, $db);

// Check connection
if (!$conn) {
die(“Connection failed: " . mysqli_connect_error());
echo ‘Sending you back to the top of the web site in 10 seconds.’;
’’;
}
echo “Connected successfully”;”;

// Create connection
$conn = mysqli_connect($host, $user, $pass, $db);

// Check connection
if (!$conn) {
die("Connection failed: " . mysqli_connect_error());
echo ‘Sending you back to the top of the web site in 10 seconds.’;
’’;

What code did you modify? Do I have to do anything with my scripts or html to take advantage of the change?

I have modified the code from msagetdb.php:

$conn = mysqli_connect($host, $user, $pass, $db);

You were not selecting the database on which to perform the query.


Also, there are query errors in your script, in mbrproc.php:

$sql="INSERT INTO members VALUES('$zipcode','$state','$precinct','$email', '$password', '$secq', '$seca', $comment)";
  1. You have not selected the columns on which to enter the values
  2. You have not provided values for the last column (stamp)
  3. Missing apostrophe on $comment

The code should be like this:

$sql="INSERT INTO members(zipcode, state, precinct, email, password, secq, seca, comment, stamp) VALUES('$zipcode','$state','$precinct','$email', '$password', '$secq', '$seca', '$comment', 'current_time')";
1 Like

msagetdb $db not required.works fine without it. Connection successful.
mbrproc.php columns not needed if values present for all columns except for id and stamp which are automatic.

Not doing any manual clicking. The php script is trying to do the insert. Problem is that apparently, there is a file, mysql.db which contains possibly all of your clients. Contains our privileges which are necessary to do insert, update, etal.

@fordsfolley Delete current database, then create a new one and try again.

I readup on administrator and might have a handle on it. Not sure how the privileges are stored but I am going to delete and replace it.

Don’t worry about that file. Nobody knows the database is yours, nor has access to it :wink:

This topic was automatically closed after 44 hours. New replies are no longer allowed.