benchmark: MisconfigBench

problem_statement:
# MySQL: setting time_zone in my.cnf options file

# Question

In MySQL you can set a session variable called **time\_zone** to change the timezone. This is useful e.g. when looking at timestamps from another country. Here is an example:

```
mysql> select now();
+---------------------+
| now()               |
+---------------------+
| 2010-12-30 18:59:18 |
+---------------------+
1 row in set (0.00 sec)

mysql> set time_zone='Brazil/East';
Query OK, 0 rows affected (0.00 sec)

mysql> select now();
+---------------------+
| now()               |
+---------------------+
| 2010-12-30 09:59:29 |
+---------------------+
1 row in set (0.00 sec)
```

Is it possible to put that in an option file e.g. .my.cnf ?

When I try, it doesn't work. All I get is:

> ```
> mysql: unknown variable 'time_zone=Brazil/East'
> ```

### Question Comments

=== COMMENTS ===
- (1) Leniel Maccaferri [Commented Dec 30, 2010 at 12:22]: What's your operating system?
- (2) dolmen [Commented Jun 27, 2018 at 14:29]: So far the answers work by changing settings the server side. I'm interested in an anwser that allows to change the time_zone for a mysql CLI session by setting something in ~/.my.cnf .

---

# Accepted Answer

it should be

```
default_time_zone=Brazil/East
```

details : <http://dev.mysql.com/doc/refman/5.5/en/server-system-variables.html#sysvar_time_zone>

> Option-File Format = default\_time\_zone

type: StackOverflow


problem_statement:
# MySQL Client Authentication Failure

A MySQL service is running in the environment.

The expected behavior is that the standard client invocation can connect
successfully:

```bash
mysql
```

Currently it fails with an authentication error:

```text
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
```

Explicit credentials are known to work, so the database service itself is
running.

Diagnose the problem and repair the environment so the default client
connection succeeds without weakening authentication.

Do not modify benchmark harness files, replace the client invocation, or
weaken authentication.


problem_statement:
# mysqld: Job failed to start

MySQL occasionally fails to start on an Ubuntu laptop. Init reports that the mysql main process exits with status 1 and eventually stops respawning. The MySQL error logs are empty.

Running the daemon manually shows:

```
[ERROR] Can't start server: Bind on TCP/IP port: Cannot assign requested address
[ERROR] Do you already have another mysqld server running on port: 3306 ?
[ERROR] Aborting
```

The laptop currently has address `192.168.1.2`, while the server reports that it is trying to bind to `192.168.1.3`. The laptop uses a DHCP Wi-Fi network. Diagnose and correct the configuration so MySQL starts reliably.


problem_statement:
I've installed nginx with php5-fpm and mysql. My nginx configuration has `root /var/www;`, PHP as the index, and `fastcgi_pass unix:/var/run/php5-fpm.sock;`. It initially downloaded PHP files instead of executing them. Now nginx will not start, and the terminal reports:

```
user directive makes sense only if the master process runs with super-user privileges
nginx: [emerg] "fastcgi_pass" directive is not allowed here in /etc/nginx/sites-enabled/default~:68
```

Please help fix the problem.