How do I restore a dump file from mysqldump?

If the database you want to restore doesn’t already exist, you need to create it first. On the command-line, if you’re in the same directory that contains the dumped file, use these commands (with appropriate substitutions): C:\> mysql -u root -p mysql> create database mydb; mysql> use mydb; mysql> source db_backup.dump;

Solutions for INSERT OR UPDATE on SQL Server

don’t forget about transactions. Performance is good, but simple (IF EXISTS..) approach is very dangerous. When multiple threads will try to perform Insert-or-update you can easily get primary key violation. Solutions provided by @Beau Crawford & @Esteban show general idea but error-prone. To avoid deadlocks and PK violations you can use something like this: begin … Read more

Difference between rake db:migrate db:reset and db:schema:load

db:migrate runs (single) migrations that have not run yet. db:create creates the database db:drop deletes the database db:schema:load creates tables and columns within the existing database following schema.rb. This will delete existing data. db:setup does db:create, db:schema:load, db:seed db:reset does db:drop, db:setup db:migrate:reset does db:drop, db:create, db:migrate Typically, you would use db:migrate after having made … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)