User Tools

Site Tools


php_mysql

This is an old revision of the document!


PHP/MySQL

Excellent tutorial on Object Oriented PHP

Using prepared statements to avoid SQL injection

Using this method of writing SQL removes the necessity of attempting to clean the input with mysql_real_escape_string()

0@@

Fill your boots on PDO here

CSV tables - equivalent of External tables in Oracle

Force user logout if session is inactive for a certain period of time

As seen on stackoverflow.com

1@@

or a “cheaper” way…

2@@

Run a shell script with an html button

3@@

Start MySQL at boot time

To start mysqld at boot time you have to copy support-files/mysql.server to the right place for your system

Set a root password after installing MySQL

4@@

Alternatively you can run:

5@@

which will also give you the option of removing the test databases and anonymous user created by default. This is strongly recommended for production servers.

Start the MySQL daemon

6@@

You can test the MySQL daemon with:

7@@

Reset a forgotten MySQL root password

Stop mysqld and restart it with the –skip-grant-tables option. This enables anyone to connect without a password and with all privileges. Because this is insecure, you might want to use –skip-grant-tables in conjunction with –skip-networking to prevent remote clients from connecting.<br /> Connect to the mysqld server with this command:

8@@

Issue the following statements in the mysql client. Replace the password with the password that you want to use.

9@@

The FLUSH statement tells the server to reload the grant tables into memory so that it notices the password change.<br /> You should now be able to connect to the MySQL server as root using the new password. Stop the server, then restart it normally (without the –skip-grant-tables and –skip-networking options).

php_mysql.1544130327.txt.gz · Last modified: 2018/12/06 21:05 by 91.177.234.129

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki