Changes

From SME Server
Jump to navigationJump to search
27 bytes removed ,  05:27, 11 September 2008
Fixing spaces
Line 27: Line 27:  
To reset the password for the MySQL root account. The MySQL root user on SME Server has a random generated password which is generated during installation. You do not need to know this password to login to MySQL with root privileges on SME Server. If you might have changed the MySQL root password you can reset it like this after getting command line access as root user:
 
To reset the password for the MySQL root account. The MySQL root user on SME Server has a random generated password which is generated during installation. You do not need to know this password to login to MySQL with root privileges on SME Server. If you might have changed the MySQL root password you can reset it like this after getting command line access as root user:
   −
  cd /var/service/mysqld
+
cd /var/service/mysqld
  sv d .
+
sv d .
  expand-template /root/.my.cnf
+
expand-template /root/.my.cnf
  expand-template /var/service/mysqld/set.password
+
expand-template /var/service/mysqld/set.password
  /usr/libexec/mysqld --bootstrap --user=mysql --skip-grant-tables < ./set.password
+
/usr/libexec/mysqld --bootstrap --user=mysql --skip-grant-tables < ./set.password
  sv u .
+
sv u .
    
Since SME Server 7.3 the runsvctrl command was replaced by the sv command so for SME Server 7.2 and earlier releases use the following:
 
Since SME Server 7.3 the runsvctrl command was replaced by the sv command so for SME Server 7.2 and earlier releases use the following:
   −
  cd /var/service/mysqld
+
cd /var/service/mysqld
  runsvctrl d .
+
runsvctrl d .
  expand-template /root/.my.cnf
+
expand-template /root/.my.cnf
  expand-template /var/service/mysqld/set.password
+
expand-template /var/service/mysqld/set.password
  /usr/libexec/mysqld --bootstrap --user=mysql --skip-grant-tables < ./set.password
+
/usr/libexec/mysqld --bootstrap --user=mysql --skip-grant-tables < ./set.password
  runsvctrl u .
+
runsvctrl u .
    
==== Restoring accidently deleted MySQL root user====
 
==== Restoring accidently deleted MySQL root user====
 
Note: The following is only applicable on SME 7.3 and MySQL 4.1  
 
Note: The following is only applicable on SME 7.3 and MySQL 4.1  
  cd /var/service/mysqld
+
cd /var/service/mysqld
  sv d .
+
sv d .
  echo 'use mysql;'>set.rootuser
+
echo 'use mysql;'>set.rootuser
  echo -n 'INSERT INTO user VALUES("localhost","root","",'>>set.rootuser
+
echo -n 'INSERT INTO user VALUES("localhost","root","",'>>set.rootuser
  echo '"Y","Y","Y","Y","Y","Y","Y","Y","Y","Y","Y","Y","Y","Y","Y","Y","Y","Y","Y","Y","Y","","","","",0,0,0);'>>set.rootuser
+
echo '"Y","Y","Y","Y","Y","Y","Y","Y","Y","Y","Y","Y","Y","Y","Y","Y","Y","Y","Y","Y","Y","","","","",0,0,0);'>>set.rootuser
  expand-template /root/.my.cnf
+
expand-template /root/.my.cnf
  expand-template /var/service/mysqld/set.password
+
expand-template /var/service/mysqld/set.password
  /usr/libexec/mysqld --bootstrap --user=mysql --skip-grant-tables < set.rootuser
+
/usr/libexec/mysqld --bootstrap --user=mysql --skip-grant-tables < set.rootuser
  /usr/libexec/mysqld --bootstrap --user=mysql --skip-grant-tables < set.password
+
/usr/libexec/mysqld --bootstrap --user=mysql --skip-grant-tables < set.password
  sv u .
+
sv u .
    
=== Access MySQL from the local network ===
 
=== Access MySQL from the local network ===
Line 70: Line 70:  
If you wish to enable access to MySQL databases from remote networks, then in addition to the LocalNetworkingOnly db setting mentioned above, you will need to execute the following commands:
 
If you wish to enable access to MySQL databases from remote networks, then in addition to the LocalNetworkingOnly db setting mentioned above, you will need to execute the following commands:
   −
  config set mysqld service access public status enabled TCPPort 3306  
+
config set mysqld service access public status enabled TCPPort 3306  
  signal-event remoteaccess-update  
+
signal-event remoteaccess-update  
  signal-event reboot
+
signal-event reboot
    
Keep in mind this enables access to your MySQL database for ANYONE, so make sure you have strong passwords on ALL your MySQL databases.
 
Keep in mind this enables access to your MySQL database for ANYONE, so make sure you have strong passwords on ALL your MySQL databases.
Line 85: Line 85:  
* Get access to the SME Server shell and issue the following commands:
 
* Get access to the SME Server shell and issue the following commands:
   −
  mysqladmin createdatabase 'name'
+
mysqladmin createdatabase 'name'
    
This will create an empty database called name.
 
This will create an empty database called name.
Line 95: Line 95:  
Decide which permissions you will have to give to the user on what database. Details about this can be found in the MySQL Manual found at the MySQL site. Get access to the SME Server shell and issue the following commands to login to the MySQL server:
 
Decide which permissions you will have to give to the user on what database. Details about this can be found in the MySQL Manual found at the MySQL site. Get access to the SME Server shell and issue the following commands to login to the MySQL server:
   −
  mysql
+
mysql
    
Suppose we want to create a user which has read-only access on all tables in the database called 'test':
 
Suppose we want to create a user which has read-only access on all tables in the database called 'test':
985

edits

Navigation menu