Skip to content
Advertisement

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. 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)


Advertisement

Answer

You need to add a space between the vi command you are trying execute and the file path you are passing to it.

sudo vi /etc/my.cnf
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement