Cannot see my database (schema) in MySQL Workbench - mysql

I recently installed mysql5.5 to my Windows 7 (x64) machine. The first problem was I couldn't enter the cmd client with mysql -u root -pmypass. The cmd opens, yields an error for like 0.5s and closes. Than I created another user account with all privileges, it worked and I created a database. But now I want to export that database from MySQL Workbench but I cannot see that in the "select a schema" option. I tried "new connection" and "new server instance" none worked.
Any suggestions?
Thanks in advance..

For the command line use WB too. In the list of connections you can right click for the context menu, which also offers to open a CLI window. In general, when you work with the CLI first open a normal CLI window (Start Menu -> Programs -> Accessories) and then try the mysql -u -p command. This way the CLI window won't close immediately and you can see what error message came out.
For WB: if you don't see a schema you know is there then probably the user you used to connect has no permissions to see it. So for tests try connecting as root and see if your schema is there. Import and Export of db objects (including entire schemas) is available in the admin section, not in the SQL IDE (where you found "Edit Table Data" etc.).

Related

MySQL 8.0 Command Line Client crashes right after entering the correct password

MySQL 8.0 Command Line Client crashes right after entering the correct password. I have also checked in services and there is no problem there. I'm using windows
This might be because MYSQL service is stopped.
Open search bar in windows and type services
Open the services application and find MYSQL application.
Click on start
Now open sql command line and try entering password
It is because MySQL Server stop, may be you run another application that use the same port. Try to run MySQL Installer Community, and you will find the program that you have to reconfigure (blue text). Try to configure MySQL Server ant click Test Connection.
It's hard to tell with no debug output or error codes, but disabling ssl might do the trick:
mysql --ssl-mode=DISABLED --host=$MYSQL_HOST --user=$MYSQL_USER ....
I had the same issue, was looking through Google to find an answer and came here. Are you sure, that you provided MySQL password? The root cause of my problem was the fact, that I put the MySQL user instead of MySQL password (the root one). Now everything is working fine.
That could mean that the password is failing. Check CapsLock key.
Go to Control Panel and uninstall MySQL Server only, you don't need to unstall the other MySQL files.
As mentioned here, make sure you can see hidden folders and then delete the following folders:
C:\Program Files\MySQL
C:\Program Files (x86)\MySQL
C:\ProgramData\MySQL
C:\Users<your-username>\AppData\Roaming\MySQL
Reinstall MySQL Server Package only
Select another password (looks like the current password is the problem)
Come here and vote me up :)
Do something nice for someone else ;)

"Authentication plugin 'caching_sha2_password' cannot be loaded. The specific module can not be found"

I am new to SQL and keep getting an error "Authentication plugin 'caching_sha2_password' cannot be loaded. The specific module can not be found" while connecting.
In your text editor of choice, open (or create) the /usr/local/etc/my.cnf file and add the following to the [mysqld] section of the file:
default-authentication-plugin=mysql_native_password
Open a terminal window, open an SSH session to your naked Mac Mini Server, and enter the following at the shell prompt:
mysql -u root -p
ALTER USER 'root'#'localhost' IDENTIFIED WITH mysql_native_password BY 'NEWPASSWORD';
Where NEWPASSWORD is the password you want to assign to the MySQL root user.
exit
Reboot your Mac.
Contents of this post is taken from farces.com
You have to "mysql_native_password" here to connect or else you have to configure "caching_sha2_password" plugin properly, as new MySQL comes with "caching_sha2_password" as below:
DROP USER 'your_user_name'#'localhost';
CREATE USER 'your_user_name'#'%' IDENTIFIED WITH mysql_native_password BY 'your_user_password';
GRANT ALL PRIVILEGES ON <db_name>.* TO 'your_user_name'#'%' identified by 'your_user_password';
The easy way around would be to reconfigure your MySQL server with a new authentication method. Just open the MySQL Installer community, and click on reconfigure next to the product MySQL Server. Keep clicking the 'Next' button until you see the authentication method window.
In this window ensure that the 'Use Legacy Authentication Method' option is selected. If not, select that option and proceed with the reconfiguration without changing any more settings. This will handle all errors that you may face when connecting to MySQL from Excel or R, etc.
In your specific case, it could be because your server is not running. To handle that, right-click on This PC on your computer and click on 'Manage'. Select 'Services and Applications' and then 'Services'. Scroll down the list that appears until you see your MySQL server. Click on the service and then click on start the service.
Before following all these instructions to downgrade your server security, make sure you have the latest version of MySQL Workbench! I kept getting that error when I tried running Workbench on an old computer. It had an older version of Workbench installed on it. I ran MySQL Installer and upgraded Workbench to the latest version and stopped getting that error.

How to use aspnet_regsql.exe

I'm having problems Creating Users in a Silverlight Business Application that uses the Local IIS Web Server.
If I use the Visual Studio Development Server I have no problems, but once I check "Use Local IIS Web Server" in the properties page and run the application, whenever I try to create a new user using "login->Register now" I get an "Unable to connect to SQL Server" error.
I found a similar problem as mine and the solution was to use aspnet_regsql in the command prompt.
If I have to use this tool, then I don't know how to use it:
aspnet_regsql.exe -S DBServerName -U DBLogin -P DBPassword -A all -d DBName
What should I enter in these parameters:
DBServerName: I guess it's ".\sqlexpress"
DBLogin and DBPassword: Kind of a login and password for the database?
DBName: If I'm not using any particular database, then what?
Please, what should I do here?
Navigate to the wizard(C:\Windows\Microsoft.NET\Framework[framework version]\aspnet_regsql) and launch it , you will be able to see a form appear and you can enter details here rather than using the command prompt.
Also within VS , from top menu select WEBSITE -> ASP.Net Configuration you should be able to see all your user and role details (you can tst the connectivity as this will pull of data based on your web.config/app.config settings)

MySQL command line won't open?

I just installed the latest version of MySQL. Until Now I had it on Windows XP but I wanted to install this on another computer with Windows 7.
Even after configuring everything correctly, the MySQL client won't show up in the Start Folder. So I went to the bin folder of MySQL and tried opening mysql.exe but it would immediately close down.
I then tried opening mysql.exe in cmd & this is what I get
C:\Program Files\MySQL\MySQL Server 5.5\bin>mysql
ERROR 1045 (28000): Access denied for user 'ODBC'#'localhost' (using password: N
O)
Any Ideas how I can get this to work?
Provide username (root)
C:\Program Files\MySQL\MySQL Server 5.5\bin>mysql -uroot
Default passsword is blank, but if you set it, you will need to provde password as well
I don't recall where I first read it, but when facing this problem before, I found that I had to manually turn on a service:
Windows key+R and type Run and hit "enter"
Type "services.msc", hit "OK"
Find "MySQL56", right-click and choose "Start"
You should now be able to log in with no trouble
That's the solution that worked for me; hopefully it helps others out there.
What #Herschel said is right if you follow his steps 1-4 then try to log in with your password in command line you'll have no trouble.
You can also make this run automatically as a service, something which you need when running it on a server.
Open Run
Type "services.msc" click ok
Find the MySQL service
Right-click properties then go down to startup type:
Change it to automatic
I followed these steps and it worked for me:
1. Open Command prompt in admin and go to the location of Mysql bin folder and type -
C:\ProgramFile\mysql\bin>mysql -u root -p <password>
2. Then the prompt asks for the password. This is the password or the root user which
you had set during installation of mysql.
3. Type the password and you will login in to mysql.
4. Also make sure your mysql service is running in the backend by going to the
windows service panel and check whether the mysql service is running.
Heyoo Heyoo. So as of today 19th March 2022 I had this same issue but imma show you how I solved it. My specs before we start:
MySql Version: 8.0
OS: Windows 10
OS Build: 19044.1586
Alright, I'm fairly new to SQL, was following along with a tutorial but when it got to the point of opening the client command line it wouldn't open, it just popped up and closed back; didn't even ask for a password. After watching several tutorials (which were very unhelpful) I noticed from those tutorials that the solution they proffered was to "Active the MYSQL80 service", but that was unhelpful to me because I couldn't see that service in the services menu.
So I decided to go back to the "MySql Installer -Community" App (I installed the community version of SQL)
After the installer had opened up I clicked on the "Reconfigure" action for MySQL Server
It opened the configuration window for the SQL Server and I followed the configuration process to set up the server (turns out I didn't initially set it up when I installed MySQL 😅😅). After the configuration process was done I went back to the services menu to see if the "MYSQL80" service was there... and it was, I checked to see if it was running; following the instructions from this tutorial. After making sure the service was running I went back to the client command line, it finally opened up, allowed me to input my password, and it's working properly!!

Unexpected error message from aspnet_regsql

I am trying to use the aspnet___regsql utility to install all the membership tables in a database on my local SQL Express 2008 instance. I can connect without problems in Management Studio, but when I try to list the databases in the aspnet_regsql interface i get an error message saying:
Failed to query a list of database names from the SQL Server.
Invalid object name 'sysdatabases'
What am I doing wrong? How do I fix this?
(Please tell me there's a smoother way than reinstalling the thing... :P)
I have solved the problem by bypassing the graphic interface and performing the same action directly in the command prompt, with flags specifying all options. They should look like this:
Connect using SQL Authentication
C:\>Windows\Microsoft.NET\Framework\v2.0.50727\aspnet_regsql.exe -S myHostingServer -A all -d myDatabase -U myUserID -P myPassword
Connect using Windows Authentication
C:\>Windows\Microsoft.NET\Framework\v2.0.50727\aspnet_regsql.exe -S myHostingServer -A all -d myDatabase -E
The difference is at the end of the lines, where SQL Auth. has -U myUsername -P myPassword while Windows Auth. has -E (which flags for Trusted Connection).
If you want to use the graphical interface, you need to make sure the user you are logged in as has the default db in SQL set to 'master' so it can connect directly to the sysdatabases table.
Ensure that in SQL Server Configuration Manager -> SQL Server Network Configuration -> Protocols for YOUR_SQL_SERVER_INSTANCE_NAME is enabled TCP/IP. NB. for applying this change need to restart YOUR_SQL_SERVER_INSTANCE_NAME
By default on Vista the current user on the machine is not a member of SysAdmin on SQL Server 2005/2008.
So here is the trick.
1-Open Sql Server Surface Area Configuration tool from C:\Program Files\Microsoft SQL Server 2005/2008.
2-When the screen pops up click on Add New Administrator.
-on top right make sure that User to provision=Username of the pc
-on your left (Available Privileges) select Member of SQL Server SysAdmin and click on the right arrow (>)
-click ok and you should be ready to go.
My name is Talley Ouro,Developer in Raleigh,NC
Blog: http://talleyblogs.blogspot.com/
Email:johnstalley#live.com
This issue is generally caused by leaving "Server" to be your machine name instead of the name of your SQL server instance. It's tricky to figure out because they autofill the text box to your machine name, which is needed but incomplete. This may lead you to think "Server" refers to the computer itself when they really mean SQL server instance. If you are connecting to your local machine you can generally append to their entry with the name of your SQL instance and everything will work as intended
IE LOCALHOST must become LOCALHOST\SQLEXPRESS or whatever you name your box\sqlserver