MySQL Forums
Forum List  »  Newbie

mysqldump restore
Posted by: eric smith
Date: January 19, 2024 11:45AM

Stuck again,
All of the examples I have been able to find on the web show the following way of creating a new database for receiving the restored backup
mysql -u -p CREATE DATABASE "dbmysql"

I have tried the following from the command line-
mysql - u -p
mysql> CREATE DATABASE "dbname";
OK, 1 row affected (0.00 sec)
So the new database is created.
I have tried to implement this in one line so as to use it in a script like this
mysql -u$user -p$password CREATE DATABASE $db_name;

This does not seem to work.
I get all the blurb about mysql and Oracle
and followedby Usage: mysql [OPTIONS] etc.
I have tried putting the line into a script file and running it but get the same result . In both cases terminal and script it seems to fail when it gets to the CREATE command.
Obviously doing something wrong but unable to figure out what.

Options: ReplyQuote


Subject
Written By
Posted
mysqldump restore
January 19, 2024 11:45AM
January 22, 2024 04:57AM


Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.