怎么查看mysql数据库位置
如果你不知道MySQL数据库存放的位置,可以通过以下方法查看:
$ mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or g. Your MySQL connection id is 2 Server version: 8.0.21-0ubuntu0.20.04.4 (Ubuntu) Copyright (c) 2000, 2020, Oracle and/or its affiliates. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or 'h' for help. Type 'c' to clear the current input statement. mysql>select @@datadirG; *************************** 1. row *************************** @@datadir: /var/lib/mysql/ 1 row in set (0.01 sec) mysql>exit Bye