NetBeans not showing all MySQL databases - mysql

I've some databases showing at MySql command line client as in the image below:
But in netbeans only the databases below are showing of the same localhost:3360 used by MySql command line client:
Why all of my databases are not showing in netbeans?

NetBeans uses the same show databases command to load the list of databases to the database explorer. You can see the source code for it here.
The show databases command only shows you those databases for which you have some kind of privilege.
You see only those databases for which you have some kind of
privilege, unless you have the global SHOW DATABASES privilege. You
can also get this list using the mysqlshow command.
So, ether NetBeans connects to a different MySQL server or you use a different user within the NetBeans connection.

Related

Database not showing in Schema section of MySQL Workbench for non-global access user

I have a user who has been given various GRANTs on specific tables in a database, and, when connecting to the database server in MySQL Workbench (Mac and Windows), can only see the schemas to which he has been granted global privileges (e.g. SELECT on other_db.*) and not the schema for which he has been given specific, non-global GRANTs.
This is specific to MySQL Workbench, and in particular, to the Schema “browser” section in the side-bar, as there is no problem with him seeing the objects when connecting via the command-line client (or rather myself doing so with his credentials) and he can even issue queries against the database tables in the query window, once a “use database” statement has been issued (again, in both the Mac and Windows versions).
Does anyone have an idea of what may be going on here?

mysql information_schema empty and not populating

Running WAMP localhost server With php 5.6.18 and MySQL 5.7.11 In project that im working on now i need to get some column data form information_schema.COLUMNS table, but information_schema DB is completely empty - 0 rows for every table in this DB For additional information - I have like 10 differnet DB on this MySQL, some are imported some are made from scratch in phpmyadmin.So im completely lost - tried to google but no luck.Maybe i miss something essential and trivial like some configuration of MySQL?
Execute this query:
mysql> SHOW GRANTS;
This will show you that either you are not logging in as the user you intend to use, or that this user lacks permissions on the tables in question.
In this case, the user may have no permissions at all. MySQL has a special permission called USAGE, which may seem slightly deceptively named if you aren't familiar with what it means. It means you can "use" the server -- that is, you can log in. But that is all it means. If you possess only the USAGE ON *.* privilege, this means you have permission to log in to the server, but no permissions on anything else.
The information_schema is integrated with the permissions system. You can't see information about database objects for which you don't have permissions. An empty information_schema.columns table suggests a permissions issue for the user you are using to connect to the server.
Sometimes this may be issue when you copy and paste the database's folders in mysql folder. Don't copy that way. The best way to export the databases using "export" command in "phpmyadmin" or use "mysqldump" command in mysql command line client to copy the data or export data from one to another.It will generate "yourdata.sql" file at the last , You can import that data using "export command in "phpmyadmin" . In your method is successful for "MyISAM" database driver in mysql. Modern mysql servers default database driver is "InnoDB" and it not success in when copy the database data folder on to another machine. If you have copy of previous copy of the databases from the old machine, try to export the "yourdata.sql" file using export method in "phpmyadmin" web interface.
I faced same problem when I transfer/shifted my mysql folder to other location.
And configured DB to point Mysql folder accordingly.
However, Information_schema was not getting updated though rest DB queries were running fine.I could't find proper solution but the way around was from mysql editor (like workbench) do inspect schema.
You will get an option in bottom to 'Information Outdated' and then click on Analyze table. You will find that Information_schema start calculating correct size and other details.

MySQL Not loading Database File from /usr/local/mysql/data

Hey Guys so the other day I was running a database schema in the mysql workbench on my mac. I had added tables populated the data and tried to run some big queries. The server died and now when I connect to my local host instance I cannot find my database. However I can still see my database file in /usr/local/mysql/data/
Can any one help me work out how to start mysql server again and get it to load in the file?
I just dont' understand why it can no longer see the schema..
Connecting as localhost, using root, both workbench and terminal can't see the file. However the file is here:
The file I want is AM_DUMPS
When I try and load it from SQL Workbench I get:
Check to see if the data directory is owned by MySQL or mysqld is not launched as the mysql user. It looks like something along those lines. You may have to adjust the permissions to make sure that mysql is the owner.

Accessing different databases via command line than phpmyadmin

I 've re-installed mysql, uninstalled MAMP.
So currently I should only have one version of mysql.
I've done the following:
Installed phpmyadmin
Created a database
I try to import data to it, but the file is too big so I do it via the command line. But there I dont see my newly created database, furthermore I see less databases.
If I do show databases; on the command it shows:
information_schema
test
It doesnt show my newly created Database and it doesn`t show other databases that were pre-installed, these are the databases that I see on phpmyadmin:
information_schema
mysql
performance_schema
test
myBBDD->the one I just created and I was looking for to import data via command-line
It seems I have two versions of mysql, but if I stop mysql via command line, I then can't access phpmyadmin so I guess it's the same one, but for some reason I can't access the same databases.
If you could throw me a bone on this? Im completely lost.
To install mysql and phpmyadmin I've followed this tutorial
[EDIT]
I tried to delete test and it did dissapear from the command-line too, so it is the same version of MySql, so it must be a permission issue... still investigating
Thanks.
Sounds like you have MAMP's version of MySQL and a standalone MySQL. See this answer:
Access MAMP's MySQL from Terminal
Just had the same issue, in my case it turned out to be that I wasn't logging in as the correct user.
In the command line, instead of running just mysql, try running mysql -u root -p (replace "root" with whatever user you used in phpMyAdmin to set the databases up). You should then be able to type in the password. Check show databases; again.
Just noticed that user Grasshopper in a previous answers' comments was suggesting exactly this, hopefully this will help someone anyway by spelling it out.

Mysql Table corrupted after restarting PC

I am working on Symfony2 Project and am beginner in symfony Framework. I am using XAMPP as webserver. Everything is working properly until system restarts. When I restart my computer the tables of mysql database using by symfony project corrupts automatically.
I am using windows 7 professional 32bit OS.so, is there any problem in mysql?
MySQL tables can become corrupt for several reasons, such as hardware
failure, operating system bugs, viruses and bugs in MySQL. hMailServer
itself does not cause corrupt MySQL tables. hMailServer communicates
with MySQL over TCP/IP using a standardized language.
There's nothing in this language that can cause corrupt tables.
If a MySQL table becomes corrupt, you need to repair it. Note that repairing a corrupt MySQL table may lead to loss of data. It's therefore important to create a backup of your system.
How do you know whether a table is corrupt?
Examine the hMailServer error log. If you see a lot of Error while executing SQL statement-messages, then it's likely that one or more of your tables are corrupt. Feel free to ask in the forum if you're unsure.
Step 1: Determine MySQL password
If you are using an external version of MySQL, you should already know your MySQL password.
If you are using the built-in MySQL version that comes with hMailServer, you might not know your password. To determine it, follow these steps:
Run the script hMailServer/Addons/Utilities/DecryptBlowfish.vbs.
Enter your main hMailServer Administrator password. This is the
password you specified during the installation when you first
installed hMailServer. Click OK.
Open up hMailserver.ini, located in your Windows directory or
hMailServer bin directory.
Copy the database password from hMailServer.ini to the "Enter
encrypted password" dialog. In hMailServer.ini, you should see a
line looking like this: [Database]
...
password=c85dae3cb73394ab
In this example, c85dae3cb73394ab is the encrypted password.
Click OK in DecryptBlowfish to view your password
DecryptBlowfish will now show your password. Either keep the dialog open or memorize the password.
Step 2: Connect to the server
To be able to repair your table, you need to connect to the MySQL server using a MySQL client. You can use SQLyog for this.
Download and install SQLyog
Create a new connection.
Enter the connection information for your MySQL server. If you are
using the built-in server, you should enter hostname: localhost,
user:root, password:password from DecryptBlowfish, port:3307
Click Connect to connect to the database server
Step 3: Repair the table
Follow these steps to run the SQL statement to repair the table.
In the tree to the left, click on the hmailserver database.
The hMailServer database will now be active.
In the right part of the SQLyog window, click on the Query tab.
Enter REPAIR TABLE tablename, for example, REPAIR TABLE hm_messages.
Click on the Execute Current Query button in the toolbar (or select
Edit->Execute Query->Execute current query or press F5).
MySQL should now repair the table. After the table has been repaired, restart the MySQL and than the hMailServer service. Depending on what table is corrupt, a restart of the services may not be required, but we recommend that you always do it.
Source