PDF (A4) - 40.3Mb
Man Pages (TGZ) - 262.0Kb
Man Pages (Zip) - 367.6Kb
Info (Gzip) - 4.0Mb
Info (Zip) - 4.0Mb
After the data directory is initialized and you have started the server, perform some simple tests to make sure that it works satisfactorily. This section assumes that your current location is the MySQL installation directory and that it has abin subdirectory containing the MySQL programs used here. If that is not true, adjust the command path names accordingly.
Alternatively, add thebin directory to yourPATH environment variable setting. That enables your shell (command interpreter) to find MySQL programs properly, so that you can run a program by typing only its name, not its path name. SeeSection 6.2.9, “Setting Environment Variables”.
Usemysqladmin to verify that the server is running. The following commands provide simple tests to check whether the server is up and responding to connections:
$> bin/mysqladmin version$> bin/mysqladmin variables If you cannot connect to the server, specify a-u root option to connect asroot. If you have assigned a password for theroot account already, you'll also need to specify-p on the command line and enter the password when prompted. For example:
$> bin/mysqladmin -u root -p versionEnter password:(enter root password here)The output frommysqladmin version varies slightly depending on your platform and version of MySQL, but should be similar to that shown here:
$> bin/mysqladmin versionmysqladmin Ver 14.12 Distrib 8.4.6, for pc-linux-gnu on i686...Server version 8.4.6Protocol version 10Connection Localhost via UNIX socketUNIX socket /var/lib/mysql/mysql.sockUptime: 14 days 5 hours 5 min 21 secThreads: 1 Questions: 366 Slow queries: 0Opens: 0 Flush tables: 1 Open tables: 19Queries per second avg: 0.000 To see what else you can do withmysqladmin, invoke it with the--help option.
Verify that you can shut down the server (include a-p option if theroot account has a password already):
$> bin/mysqladmin -u root shutdownVerify that you can start the server again. Do this by usingmysqld_safe or by invokingmysqld directly. For example:
$> bin/mysqld_safe --user=mysql &Ifmysqld_safe fails, seeSection 2.9.2.1, “Troubleshooting Problems Starting the MySQL Server”.
Run some simple tests to verify that you can retrieve information from the server. The output should be similar to that shown here.
Usemysqlshow to see what databases exist:
$> bin/mysqlshow+--------------------+| Databases |+--------------------+| information_schema || mysql || performance_schema || sys |+--------------------+ The list of installed databases may vary, but always includes at leastmysql andinformation_schema.
If you specify a database name,mysqlshow displays a list of the tables within the database:
$> bin/mysqlshow mysqlDatabase: mysql+---------------------------+| Tables |+---------------------------+| columns_priv || component || db || default_roles || engine_cost || func || general_log || global_grants || gtid_executed || help_category || help_keyword || help_relation || help_topic || innodb_index_stats || innodb_table_stats || ndb_binlog_index || password_history || plugin || procs_priv || proxies_priv || role_edges || server_cost || servers || slave_master_info || slave_relay_log_info || slave_worker_info || slow_log || tables_priv || time_zone || time_zone_leap_second || time_zone_name || time_zone_transition || time_zone_transition_type || user |+---------------------------+ Use themysql program to select information from a table in themysql schema:
$> bin/mysql -e "SELECT User, Host, plugin FROM mysql.user" mysql+------+-----------+-----------------------+| User | Host | plugin |+------+-----------+-----------------------+| root | localhost | caching_sha2_password |+------+-----------+-----------------------+At this point, your server is running and you can access it. To tighten security if you have not yet assigned a password to the initial account, follow the instructions inSection 2.9.4, “Securing the Initial MySQL Account”.
For more information aboutmysql,mysqladmin, andmysqlshow, seeSection 6.5.1, “mysql — The MySQL Command-Line Client”,Section 6.5.2, “mysqladmin — A MySQL Server Administration Program”, andSection 6.5.6, “mysqlshow — Display Database, Table, and Column Information”.
PDF (A4) - 40.3Mb
Man Pages (TGZ) - 262.0Kb
Man Pages (Zip) - 367.6Kb
Info (Gzip) - 4.0Mb
Info (Zip) - 4.0Mb