I have a sql query done by someone. I cannot seem to see the table where query is reading from, but offline, the table is in the same db. The dbconfig is the same offline and online.
Is there any way I can find where the table is, or unhide if hidden.
Thanks Jean
This sounds like a permissions issue. If you're the database administrator, login as root to see all the tables that exist. (If you can't see it as root, it just plain doesn't exist.)
If you're not the database administrator, contact whoever is to get access.
you can try running the query "show full processlist;" which will show you what connections exist, what database they are connected to, and what query they are currently executing.
You can also turn on query logging by adding "log = /path/to/logfile" to the config file or "-l logfile" to the mysqld command line and watch the queries executed there, though note that this can be a performance killer.
Please post the query. Some points to consider -
Maybe you are not in the correct database. Change to that database & try again.
Maybe you don't have permissions to log into that DB. Your script has (thanks to correct username, password).
That's all I can think of for now. Post your query so answer can be more constructive...
Thanks issue solved.
[edit]
Sorry guys...
#pekka ofcourse, had to jot quickly to close the issue.
I was auditing couple of servers, and noticed that one particular table in a db was missing, but queries was fine. It was on one server, which had nothing to do with the db. I had root access, but could not see anything, but a test db.
Thanks all for your help, as you all have been. Every answer is equal to a correct answer, and I am unable to mark it correct. Therefore I have given an upvote for all.
Thanks again
Related
I have connected to my work database via DBeaver. Recently colleague told me about a procedure that lets me check newly added entities through our front-end.
And I can't find it in the list of procedures, nor using this query:
SHOW PROCEDURE STATUS WHERE Name LIKE '%name%'
I have the same connection settings as my colleague's, same user, etc, but he uses DbForge and I use DBeaver, cause at some point of time DbForge began having too much restrictions for free version (I wasn't simply able to execute queries), and the older version my colleague gave me didn't install in Windows 11.
So, I'm thinking may be there's some settings in the DBeaver that hide certain stored procedures, or I need to adjust connection settings.
Does anyone has clue on this?
Or may be someone could suggest some alternative to DbForge, which allows to execute queries in the free version and to set colors to connections (I find that thing convenient), and possibly doesn't have this problem, may be because of being more MySQl-oriented.
Thanks in advance!
I've tried to open connection settings and check out the additional parameters there, but can't seem to notice anything relevant.
Ok, seems like there was misunderstanding between me and my colleague, and he actually meant some another DB Server, but with same User/Password combination. Thanks for the comments, that also helped in finding the cause. I really did install MySQL Workbench, saw the same picture in there, and started wondering what else it could be and reading our communication again.
My mistake) The question is no longer actual.
I sort of have a heart attack of a problem. I had a non-root utility user in mysql that used to be able to see all the databases, tables, etc. on the mysql instance. The user was also able to insert records, delete records, create tables, etc. too. This user is used by scripts to edit records, or view the data as someone who's not root via phpmyadmin.
I don't know how Django fits into this or if it was even the cause but a contractor needed access to the db to work on their project we asked them to work on. They said they were using Django and needed to create some auth tables in the database (auth_group, auth_user, auth_user_groups, etc.)
However, after they added their tables for Django, that utility user can't see anything except the "information_schema" database.
Luckily, I checked using the root user in mysql and can see the databases but somehow, I still cant see the databases with the non-root user. I don't see anything that jumps out at me permissions-wise in the "user" table in mysql so I'm not sure how to fix this problem. I want to see what commands the contractor ran to get us into this situation to tell them not to do this again.
I was going to check the .mysql_history file in the unix root user directory but the funny thing is the file is dated from 3 weeks ago so it doesn't look like this will yield any info on what was run.
So, back to my original question, where can I see a history of mysql commands that were run on mysql so I can figure out what happened or what was run to get us into this funny situation?
I am using joomla as CMS I have a system of creating users from the back end and give those login information to the users to log in our site we are following this system as we only serve a selected group of people.
but I have noticed that some records were missing randomly in our database we are using phpmyadmin and database MySQL ,I have noticed the issue when some users complained that they couldn't login on our site with the credentials provided by us .When I checked the database table I found out that some records were missing randomly .I am totally puzzled and helpless please help me.
Records do not under any normal circumstance disappear from databases spontaneously. Some specific actions must cause this.
First, carefully analyse your reasons for thinking the database ever had the record.
You have a process by which data is created. Suppose the code went:
Generate username/password
Print it out (and hence pass to user)
Insert into database
and that last step failed, would you ever know? Can you run a quick query across the database when you believe the record should be there to check that it is?
If instead your code goes
Generate username
Insert into database
Read from database
Print it out
Then you have some evidence that the record did exist, now you need to track down when the deletion occurred. Somewhere there must be a delete running.
You need to get very analytic, gather evidence.
Hi i'm new on this site and i thank you all right now for the help you guys are hopefully going to give me. I am also new to the mysql enviroment. So, i have been told by my professor to find some tools which given in input log files (general or slow query) reproduces on a mysql server all the queries such as select, delete, update and insert. The tool should possibly be multi-threaded. I found something like mysql workbench or mk-log-player but i'm not sure if that is what i am looking for since as i have told before i'm new in the mysql enviroment.
I think You want Sql client for using Mysql
use SQL-yog client it is good for multiple connections to database.
you can download it from here
http://code.google.com/p/sqlyog/downloads/list
For optimizing system performance, we are storing a few static tables on RAM (copies of which does exist on the hard-drive as well -- on the MyISAM). Now, as we all know, when the server re-starts all data on RAM gets deleted. Hence to avoid that we created an init file that has 4 SQL statements.
Please note that each SQL statement exists on a separate line, ended with a semi-colon (;) and there are no comments anywhere --- so from my limited knowledge, I believe that I have avoided making some basic mistakes. However, when I re-start MySQL manually from the command line to test it, I see that the memory tables are empty. There are no issues with the initfile itself, because when I execute the initfile manually from the command line, the data gets populated without any issues.
Any help in terms of resolving this will be much appreciated!
Thanks!
Udayan
Something is not right here.
Just to check, I tried restarting my local mysql server using /etc/init.d/mysql restart. And, it started up as running by the mysql user (not root).
So, we will need the following to try to figure this out because I am just about positive that the problem is either that the file has the wrong permissions or it is in a location that the user running mysqld does not have access to.
What version of Linux are you running?
What is the version of mySQL that you have installed?
Is 'init-file=' in the right section of my.cnf?
What is the output of 'ps -ef | grep mysqld'?
What is the output of 'ls -lrt /tmp/initfile.sql'?
What did you mean by 'There are no issues with the initfile itself,
because when I execute the initfile manually from the command line,
the data gets populated without any issues.'?
I cannot help but think that it is a permissions problem. So the fourth and fifth answers are the ones that I am most interested in.
You should add all of these answers to your question - so that people have everything they need to help you solve your problem.
Appreciate all your suggestions but I have figured out what the issues were.
In the SQL file I needed to mention which database that init-file should populate.
I had trailing semi-colons in the SQL statements -- apparently that is not a good idea.
Once I made these two small changes, everything started working fine.
Again, thanks for the pointers!
Udayan