# phpman > man > Apache::Session::MySQL

## NAME
    [Apache::Session::MySQL](https://www.chedong.com/phpMan.php/perldoc/Apache%3A%3ASession%3A%3AMySQL/markdown) - An implementation of [Apache::Session](https://www.chedong.com/phpMan.php/perldoc/Apache%3A%3ASession/markdown)

## SYNOPSIS
     use [Apache::Session::MySQL](https://www.chedong.com/phpMan.php/perldoc/Apache%3A%3ASession%3A%3AMySQL/markdown);

     #if you want [Apache::Session](https://www.chedong.com/phpMan.php/perldoc/Apache%3A%3ASession/markdown) to open new DB handles:

     tie %hash, '[Apache::Session::MySQL](https://www.chedong.com/phpMan.php/perldoc/Apache%3A%3ASession%3A%3AMySQL/markdown)', $id, {
        DataSource => 'dbi:mysql:sessions',
        UserName   => $db_user,
        Password   => $db_pass,
        LockDataSource => 'dbi:mysql:sessions',
        LockUserName   => $db_user,
        LockPassword   => $db_pass
     };

     #or, if your handles are already opened:

     tie %hash, '[Apache::Session::MySQL](https://www.chedong.com/phpMan.php/perldoc/Apache%3A%3ASession%3A%3AMySQL/markdown)', $id, {
        Handle     => $dbh,
        LockHandle => $dbh
     };

## DESCRIPTION
    This module is an implementation of [Apache::Session](https://www.chedong.com/phpMan.php/perldoc/Apache%3A%3ASession/markdown). It uses the MySQL backing store and the
    MySQL locking scheme. See the example, and the documentation for [Apache::Session::Store::MySQL](https://www.chedong.com/phpMan.php/perldoc/Apache%3A%3ASession%3A%3AStore%3A%3AMySQL/markdown)
    and [Apache::Session::Lock::MySQL](https://www.chedong.com/phpMan.php/perldoc/Apache%3A%3ASession%3A%3ALock%3A%3AMySQL/markdown) for more details.

## AUTHOR
    This module was written by Jeffrey William Baker <<jwbaker@acm.org>>.

## SEE ALSO
    [Apache::Session::File](https://www.chedong.com/phpMan.php/perldoc/Apache%3A%3ASession%3A%3AFile/markdown), [Apache::Session::Flex](https://www.chedong.com/phpMan.php/perldoc/Apache%3A%3ASession%3A%3AFlex/markdown), [Apache::Session::DB_File](https://www.chedong.com/phpMan.php/perldoc/Apache%3A%3ASession%3A%3ADBFile/markdown),
    [Apache::Session::Postgres](https://www.chedong.com/phpMan.php/perldoc/Apache%3A%3ASession%3A%3APostgres/markdown), [Apache::Session](https://www.chedong.com/phpMan.php/perldoc/Apache%3A%3ASession/markdown)

