简体   繁体   English

我无法更改以及如何打开 /etc/my.cnf

[英]i cannot change and how to open /etc/my.cnf

I'm new to laravel I'd like to change utf8 from the others but I don't know why i was not able to open the file and change.我是 laravel 的新手,我想从其他人那里更改 utf8,但我不知道为什么我无法打开文件并进行更改。 please help.请帮忙。

[mac]$ docker-compose exec mysql bash
root@5f:/ sudo vi /etc/my.cnf
bash: sudo: command not found 

root@5f6:/  /etc/init.d/mysql restart
 % docker-compose up -d
 % docker-compose exec mysql bash
root@5f2:/ sudo vi /etc/my.cnf

bash: sudo: command not found

docker-compose exec mysql bash
mysql -u root -p
mysql> SHOW VARIABLES LIKE '%char%';
+--------------------------+----------------------------+
| Variable_name            | Value                      |
+--------------------------+----------------------------+
| character_set_client     | latin1                     |
| character_set_connection | latin1                     |
| character_set_database   | latin1                     |
| character_set_filesystem | binary                     |
| character_set_results    | latin1                     |
| character_set_server     | latin1                     |
| character_set_system     | utf8                       |
| character_sets_dir       | /usr/share/mysql/charsets/ |
+--------------------------+----------------------------+
8 rows in set (0.09 sec)


You need to add a space between the vi command you are trying execute and the file path you are passing to it.您需要在您尝试执行的 vi 命令和您传递给它的文件路径之间添加一个空格。

sudo vi /etc/my.cnf

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM