Integer types can handle positive and negative numbers, but if the data type is followed by UNSIGNED, only 0 and positive numbers can be stored. Such data types are called unsigned integer types. For example, to make INT type unsigned, write as follows.
– どのユーザーがいるか知りたい SELECT user, host, password FROM mysql.user
mysql> select user,host from mysql.user;
+——+———————–+
| user | host |
+——+———————–+
| user | % |
| root | 127.0.0.1 |
| root | ::1 |
| | localhost |
| root | localhost |
| saru | localhost |
| | localhost.localdomain |
| root | localhost.localdomain |
+——+———————–+
8 rows in set (0.21 sec)
-ユーザー権限 SHOW GRANTS FOR root@`localhost`
mysql> show grants for root@localhost;
+———————————————————————+
| Grants for root@localhost |
+———————————————————————+
| GRANT ALL PRIVILEGES ON *.* TO ‘root’@’localhost’ WITH GRANT OPTION |
| GRANT PROXY ON ”@” TO ‘root’@’localhost’ WITH GRANT OPTION |
+———————————————————————+
2 rows in set (0.06 sec)
– 管理用ユーザー
GRANT ALL ON *.* TO adminuser@`%` IDENTIFIED BY ‘password’ WITH GRANT OPTION;
– IP制限
GRANT ALL ON *.* TO adminuser@’172.16.0.0/255.255.255.0′ IDENTIFIED BY ‘password’ WITH GRANT OPTION;
– 全てのデータベースにアクセス
GRANT ALL ON *.* TO testuser@’%’ IDENTIFIED By ‘password’;
– 特定のデータベースにアクセス
GRANT ALL ON testdatabase.* TO testuser@’%’ IDENTIFIED BY ‘password’;
ref: create user with GRANT Privileges in Terminal
cat /proc/version
[vagrant@localhost ~]$ cat /proc/version
Linux version 2.6.32-754.14.2.el6.x86_64 (mockbuild@x86-01.bsys.centos.org) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-23) (GCC) ) #1 SMP Tue May 14 19:35:42 UTC 2019
uname -a
[vagrant@localhost ~]$ uname -a
Linux localhost.localdomain 2.6.32-754.14.2.el6.x86_64 #1 SMP Tue May 14 19:35:42 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
There are two types of character code, Unicode, which has no BOM and with a BOM. BOM stands for byte order mark, which is a few bytes of data attached to the beginning of Unicode encoded text.
When the program reads text data, it determines from the first few bytes that it is Unicode data and which kind of encoding format is adopted. In the case of UTF-8 with BOM, the first 3 bytes are BOM, and the data is <0xEF 0xBB 0xBF>
Depending on the application such as Microsoft Excel, it may not be possible to determine whether the encoding method is UTF-8, UTF-16, UTF-32, or another different character code unless BOM is added. On the other hand, for HTML files used as web pages, it is better to save / overwrite without BOM. This is because some programs such as PHP that process web pages dynamically can not process text files with BOMs correctly. It can not generally be said that which way is better depending on the situation like this.
The difference between a file with BOM and a file without BOM is the presence or absence of the first 3 bytes, and the contents of other files and the character code (encoding system) are exactly the same. This means that if the encoding method is not correct, it will be displayed normally as a simple text file, so it can be said that it is difficult to notice that the BOM is the cause if the file malfunctions in any program.