Connect to the mysql database as the root user from the MySQL CLI : MySQL « Command MySQL « SQL / MySQL
SQL / MySQL
Insert Delete Update
SQL / MySQL
Connect to the mysql database as the root user from the MySQL CLI
mysql -u root -p mysql
Related examples in the same category
Processing SQL Files with mysql
Change default-character-set for backup
Connects the root account to the inventory database:
Connect to the MySQL database as root
Import a SQL-format dump file back into MySQL
If you dumped tables from a single database, you'll need to tell mysql which database to import them into
Verify whether the MySQL databases have been properly installed and configured.
Specify the user for mysql
To operate the mysql client utility in the context of the root user.
Specify a database when you start the mysql utility
To invoke mysql interactively from the command line, specify any necessary connection parameters after the command name
Provide a database name to select that database as the default database
Restoring a Single Database
Restoring Several Databases
Restoring a Database
Recreate the database in interactive mode:
Connect to the sampdb database on the local host and on cobra.snake.net:
Telling mysql to Read Queries from a File
MySQL Server and Included Administrative Tools
Common Options of the MySQL Client Tools
Producing HTML Output
Producing XML Output
Using the mysql Client to Export Data
Launching mysql with the option --silent:
XML Exporting with mysql
Sign into the MySQL server as root
The options part of the mysql command line might be empty
To determine the version of a program, use the --version option.
To determine the options supported by any MySQL program, invoke the program with the --help option.
Try out the various communication protocols
Find out which options will be taken from option files by mysql, use this command
Specifying Queries on the Command Line
To run multiple queries with the -e option, separate them with semicolons:
Getting Server Metadata
Produce output in formats other than tab-delimited
The prompt command supports a number of options that allow you to display the mysql prompt in various ways.
To connect to a server running on some other machine, it's necessary to specify the hostname using an -h option.
In many cases, a given option has both a long and a short form.
Connect with the same options as the previous example, but using the corresponding short option forms:
Generating HTML Tables
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.