After I choose default DB with -
USE testDB
How can I cancel it and go back to work with no default DB ?
I use - MYSQL WORKBENCH version 5.4.14
The USE schema command is a convenience command to avoid having to explicitly qualify all identifiers that belong to a gvien schema. More informations in the MySQL docs.
A side note: I strongly recommend to always use the latest MySQL Workbench version. We are constantly fixing bugs and add new cool fetaures.
Related
I would like to send Excel data to mysql database using mysql for Excel. But when I click Connection(any connection), An error appears:"The given key was not present in the dictionary"
how can i fix it?
Thank you.
I had the same issue and just solve it today.
I used to have "MySQL Server Version: 8.0.31".
I've downgraded it to "8.0.20" and now it's working.
MySQL Installer Overview
To downgrade it, I
(1) Removed the current MySQL Server Installation
(2) then i "Add" the new one, but explicitly selected "8.0.20"
Version Overview
Be Aware!
When Deleting the MySQL Server, your current Databases will be removed. Make sure you have Backups / Exports of it.
I recently created a database server in Digital Ocean, and it only supports MySQL 8. When I try to import a database of my Laravel project it reports this error:
Unable to create or change a table without a primary key, when the system variable 'sql_require_primary_key' is set.
So I tried to change the sql_require_primary_key to OFF in mySQL server by running the command,
set sql_require_primary_key = off;
And it changed successfully, but after that it automatically returned to the previous setting.
In Laravel, some primary keys are set after creating the table, so it showing error while migrating. It's my live project so that I can not modify the migrations I already created.
Anyone knows how to change the sql_require_primary_key permanently on MySQL 8?
A temporary workaround is to add turn sql_require_primary_key off for a Laravel project, you may add a statement for each database connection.
Inside Illuminate/Session/Console/stubs/database.stub, add this above Schema::create():
use Illuminate\Support\Facades\DB;
DB::statement('SET SESSION sql_require_primary_key=0');
Schema::create('sessions' ...
Once you have done the migration and restore, you can remove this change.
If you use Digital Ocean's API, there documentation on the API here. Alternatively, you may contact their support to turn that requirement off for your server.
I am totally new to databases. I would like to create a database; I am going to make a small project which is going to use DB. I am going to use Maria DB as it is totally free for commercial use.
The question is: Can I use MySQL workbench program to create a database and then transform/change it to MariaDB?
From my experience -- Sure, you can use MySQL Workbench with MariaDB.
However, I have tried basic functionalities only, like queries, schema design etc. Not sure about compatibility of advanced features.
So my experiences are, yes you can use MySQL Workbench for MariaDB database designs.
However I needed to change the "Default Target MySQL Version" to 5.7.
This can be done by going to: Edit->Preferences in the menu. And finally to Modeling->MySQL.
Since the latest MySQL version, v8.x, the SQL statements are not compatible with MariaDB statements (like creating an index). MariabDB creating an index on a table:
INDEX `fk_rsg_sub_level_rsg_top_level1_idx` (`rgs_top_level_id` ASC)
vs
MySQL:
INDEX `fk_rsg_sub_level_rsg_top_level1_idx` (`rgs_top_level_id` ASC) VISIBLE
MariaDB can't handle this VISIBLE keyword in this example. Using an old MySQL Version, MySQL Workbench will forward engineer a compatible MariaDB SQL file.
Currently (Oct 2019) the generated SQL_MODE output is still compatible with MariaDB. Just like InnoDB, which is also preferred when using MariaDB in most cases.
Just to list a few other options:
MySQL Workbench
Heidi Sql
SQLyog
No.
The latest version of Workbench 8.0 is not supported in MySQL.
Yes, although connecting to view existing database on a remote MariaDB server will crash the current client (6.3.10). I use it mainly to deploy database models and that works fine, even on remote servers.
I just deployed to a MariaDB 10.3 server with that client and it worked fine, see screenshot.
Is it possible to change the default collation of SQL Server 2008 without having to reinstall the whole package ? It has to be Case Sensisitve by default - the application server I have checks this as a pre condition to installing and creating a database.
Yes it is, but it is not for the faint of heart...
From http://msdn.microsoft.com/en-us/library/ms179254.aspx:
Changing the default collation for an instance of SQL Server can be a
complex operation and involves the following steps: Make sure you
have all the information or scripts needed to re-create your user
databases and all the objects in them.
Export all your data using a tool such as the bcp Utility. For more
information, see Importing and Exporting Bulk Data.
Drop all the user databases.
Rebuild the master database specifying the new collation in the
SQLCOLLATION property of the setup command. For example:
Setup /QUIET /ACTION=REBUILDDATABASE /INSTANCENAME=InstanceName
/SQLSYSADMINACCOUNTS=accounts /[ SAPWD= StrongPassword ]
/SQLCOLLATION=CollationName
For more information, see Rebuilding System Databases.
Create all the databases and all the objects in them.
Import all your data.
If you can get away with just changing the default collation of the database(s) specific for the application, you may want to do that...
Caveat: I have zero experience with MySQL.
I've been given a series of files to do a data conversion and would like to migrate the provided data into SQL Server 2008. The files are:
*.myd
*.myi
*.frm
These file types, as I understand it, are MyISAM. I believe that if I had a running MySQL instance, migrating to SQL Server would be fairly straightforward. I could could either use SQL Server's import wizard or Microsoft SQL Server Migration Assistant for MySQL v1.0. Unfortunately, these files are what I'm stuck with -- I just don't have access to the original MySQL instance.
I also don't presently have MySQL as a running instance locally and I'm not sure if there would be compatibility issues with the files I have.
Can I attach them to MySQL 5.5 with the goal of performing a SQLDump or perhaps to use either tool mentioned above? Am I missing a better way?
Yes, you can easily attach them to MySQL 5.5. Then you can dump the tables using mysqldump (be aware that you will need to either modify dump and remove mysql-specific stuff from the dump, or probably customize mysqldump output - check mysqldump documentation for details). You can also try to link Mysql instance to SQL Server, and then copy tables using SELECT ... INTO [sql_server_table_name] FROM [mysql_table_name].
In any case, the hardest part is to migrate stored procedures/triggers. Mysql and SQL Server have quite a different syntax for them, so you probably cannot automate this process.
Update
Also, I forgot to mention that you will have to modify mysql auto_increment columns to IDENTITY([next_auto_increment_value],1) SQL server.