Difference between revisions of "MySQL"

From Secure Computing Wiki
Jump to: navigation, search
(New page: <ol><li>Install MySQL 5.1 from the FreeBSD ports collection: <pre># cd /usr/ports/databases/mysql51-server # make install clean</pre> <li>Modify /etc/rc.conf to enable mysql server: <pre>...)
 
Line 5: Line 5:
 
<li>Modify /etc/rc.conf to enable mysql server:
 
<li>Modify /etc/rc.conf to enable mysql server:
 
<pre># echo 'mysql_enable="YES"' >> /etc/rc.conf</pre>
 
<pre># echo 'mysql_enable="YES"' >> /etc/rc.conf</pre>
 +
 +
<li>Start the MySQL Database server:
 +
<pre># /usr/local/etc/rc.d/mysql-server start
 +
 +
<li>Secure MySQL root account:
 +
<pre># mysql -u root
 +
mysql> use mysql;
 +
 +
Database changed
 +
 +
mysql> UPDATE user SET password=PASSWORD('yuf9898a') WHERE user='root';
 +
 +
Query OK, 3 rows affected (0.00 sec)
 +
Rows matched: 3  Changed: 3  Warnings: 0
 +
 +
mysql> FLUSH PRIVILEGES;
 +
Query OK, 0 rows affected (0.00 sec)
 +
</pre>

Revision as of 20:21, 11 May 2007

  1. Install MySQL 5.1 from the FreeBSD ports collection:
    # cd /usr/ports/databases/mysql51-server
    # make install clean
  2. Modify /etc/rc.conf to enable mysql server:
    # echo 'mysql_enable="YES"' >> /etc/rc.conf
  3. Start the MySQL Database server:
    # /usr/local/etc/rc.d/mysql-server start
    
    <li>Secure MySQL root account:
    <pre># mysql -u root
    mysql> use mysql;
    
    Database changed
    
    mysql> UPDATE user SET password=PASSWORD('yuf9898a') WHERE user='root';
    
    Query OK, 3 rows affected (0.00 sec)
    Rows matched: 3  Changed: 3  Warnings: 0
    
    mysql> FLUSH PRIVILEGES;
    Query OK, 0 rows affected (0.00 sec)