Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8359677
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T11:13:33+00:00 2026-06-09T11:13:33+00:00

Another little bit which I am missing (as a beginner) I have a Backup

  • 0

Another little bit which I am missing (as a beginner) I have a Backup script between two DB and as a final step I should optimise the real DB to reduce the size of the overhead. I have a code which works when I use only one DB but I need to use two:

$actconn = mysql_connect($dbhost, $actdbuser, $actdbpass) or die ('act Error connecting to mysql');
$bckconn = mysql_connect($dbhost, $bckdbuser, $bckdbpass) or die (' back Error connecting to mysql');

$ressql="SHOW TABLE STATUS FROM $actdbname WHERE Data_free / Data_length > 0.1 AND Data_free >  102400";

– this should tell that bckuser is ignored, I believe…

 $res = mysql_query( $ressql, $actconn);

 echo mysql_error(); 
while($optrow = mysql_fetch_assoc($res)) {
  mysql_query('OPTIMIZE TABLE ' . $optrow['Name'], $actconn);
}

actconn value: Resource id #1

bckconn value: Resource id #2

mysql_error says:

SELECT command denied to user ‘bckuser’@’localhost’ for table ‘actual table’

any idea what I do wrong?

UPDATE:
bckuser should not do anything with it as actdbuser is the root of that DB, but some reason SHOW TABLE won’t recognise $actconn…

UPDATE2:
I tried just the opt again and the only thing is changed is the $actdbname=’db-name’; when working and $actdbname=’db-name‘ with the spec apostrophe;

please note this is on sharedhost so I can’t change the DB name.

thanks @Corbin interesting idea, I tried and didn’t work, but how could I debug it? I can’t even debug it properly some reason…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T11:13:34+00:00Added an answer on June 9, 2026 at 11:13 am

    You need to have a proper grant permissions to user ‘bckuser’@’localhost’ for executing SHOW TABLE STATUS query.

    Unfortunately in MySQL 5.5 there is no separate grant option for this operation. Alternatively you can grant ALL to this user or use root user login for doing this operation.
    see Grants Manual

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have just come a little bit unstuck, I have a list which I
I am in a little bit of a bind. Another dept. at work asked
I'm getting a little bit frustrated since I can't find out which variables I
I have two pages one is the main page and the another one is
I have read some web articles about Three-Tier Architecture. However, I am little bit
This is a little bit of weird problem here. Say I have a C++
I have a cursor which returns two values: one which I will use (and
First I am new in the forum so please have a little bit patience
I have a little bit philosophical question. There is a class A class A
Ok, little bit of background here. I have a large scale web application (MVC3)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.