linuxÖÐmysqlÊý¾ÝĿ¼ÔÚÄÄ
linuxÖÐmysqlÊý¾ÝĿ¼µÄĬÈÏλÖÃÊÇ¡°/var/lib/mysql¡±£¬Õâ¸öĿ¼°üÀ¨ÁË mysql ЧÀÍÆ÷´æ´¢ËùÓÐÊý¾Ý¿âÎļþµÄλÖ㬰üÀ¨Êý¾Ý±í¡¢Ë÷Òý¡¢ÈÕÖ¾ÒÔ¼°ÆäËûÏà¹ØÎļþ£¬ÈôÊÇÏ£ÍûÈ·ÈÏ»òÕßÐÞ¸ÄĬÈÏλÖ㬿ÉÒÔÉó²é mysql µÄÉèÖÃÎļþ my.cnf »òÕß my.ini ÖÐµÄ datadir ²ÎÊý£¬¸Ã²ÎÊýÖ¸¶¨ÁËÊý¾ÝĿ¼µÄ·¾¶¡£
±¾½Ì³Ì²Ù×÷ϵͳ£ºLinux5.18.14ϵͳ¡¢Dell G3µçÄÔ¡£
ÔÚ´ó´ó¶¼ Linux ϵͳÖУ¬MySQL Êý¾ÝĿ¼µÄĬÈÏλÖÃÊÇ /var/lib/mysql¡£
Õâ¸öĿ¼°üÀ¨ÁË MySQL ЧÀÍÆ÷´æ´¢ËùÓÐÊý¾Ý¿âÎļþµÄλÖ㬰üÀ¨Êý¾Ý±í¡¢Ë÷Òý¡¢ÈÕÖ¾ÒÔ¼°ÆäËûÏà¹ØÎļþ¡£Çë×¢ÖØ£¬Ïêϸ·¾¶¿ÉÄÜÒò²î±ðµÄ Linux ¿¯ÐаæºÍ MySQL °æ±¾¶øÓÐËùת±ä£¬µ«´ó´ó¶¼ÇéÐÎ϶¼ÊÇÔÚ /var/lib/mysql Ŀ¼Ï¡£ÈôÊÇÄãÏ£ÍûÈ·ÈÏ»òÕßÐÞ¸ÄĬÈÏλÖ㬿ÉÒÔÉó²é MySQL µÄÉèÖÃÎļþ my.cnf »òÕß my.ini ÖÐµÄ datadir ²ÎÊý£¬¸Ã²ÎÊýÖ¸¶¨ÁËÊý¾ÝĿ¼µÄ·¾¶¡£
ÔÚ Linux ÖУ¬¿ÉÒÔͨ¹ýÒÔÏÂÏÂÁîÀ´²éÕÒ MySQL Êý¾ÝĿ¼£º
mysql_config --variable=pkgdatadir
µÇ¼ºó¸´ÖÆ
ÔËÐÐÒÔÉÏÏÂÁî»áÊä³ö MySQL Êý¾ÝĿ¼µÄ·¾¶¡£ÇëÈ·±£ÒѾװÖÃÁË mysql_config ¹¤¾ß¡£
ÁíÍ⣬ÄãÒ²¿ÉÒÔʹÓÃÒÔÏÂÏÂÁî¾ÙÐÐËÑË÷£º
find / -name mysql
µÇ¼ºó¸´ÖÆ
Õâ»áÔÚÕû¸öÎļþϵͳÖÐËÑË÷ËùÖøÃûΪ “mysql” µÄÎļþºÍĿ¼£¬²¢ÏÔʾ³öËüÃǵÄ·¾¶¡£Í¨³££¬Êý¾ÝĿ¼µÄÃû³ÆÊÇ “mysql”£¬Òò´ËÄã¿ÉÒÔÔÚËÑË÷Ч¹ûÖÐÕÒµ½Ëü¡£
ÈôÊÇÄãÊÇÒÔ root Óû§Éí·ÝÔËÐÐÉÏÊöÏÂÁÔò¿ÉÒÔËÑË÷Õû¸öÎļþϵͳ¡£²»È»£¬¿ÉÄÜÖ»ÄÜËÑË÷µ½ÄãÓÐȨÏÞ»á¼ûµÄĿ¼¡£
ÒÔÉϾÍÊÇlinuxÖÐmysqlÊý¾ÝĿ¼ÔÚÄĵÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡