13
1 User Guide Portfolio SQL Connect This installation procedure is detailed, and as of this writing, necessary to properly install MySQL 4.1.11, MyODBC 3.51.11 and create your SQL catalog. Due to the nature of open source software, this procedure may be simplified in the future as upgrades are implemented to installers and the source code. If you purchase a Mac that has Mac OS X Server pre-installed (for example an XServe) MySQL version 4.0 is already installed. SQL Connect requires MySQL version 4.1.11 or higher to run successfully. MySQL version 4.0 must be completely removed before installing version 4.1.11. To read instructions and download a script that removes the earlier version, please visit: http://www.entropy.ch/software/macosx/ mysql/remove-old-mysql.html For the most current MySQL setup and installation instructions please visit: http://www.extensis.com/downloads/ Install MySQL and MyODBC 1. Download the most current MySQL installer from http://www.mysql.com/downloads/ 2. Double-click mysql-standard-4.1.11-apple- darwin7.8.0-powerpc.dmg to mount the disk image. At the time of this writing, this is the most current filename. Your filename may be slightly different. 3. To install MySQL, double-click on the mysql-standard-4.1.11-apple-darwin7.8.0- powerpc.pkg installer package. Follow the installer instructions to complete the installation. 4. When the MySQL installation is complete, double- click MySQLStartupItem.pkg installer package to install it as well. 5. Download the current Connector/MyODBC installer from http://www.mysql.com/downloads/. 6. Launch the installer and follow the instructions. When the Connector/ODBC - Configure Data Source Name dialog box appears, click Cancel. You will create the DSN in a later step. Configure the database server 1. Log in to Mac OS X as any user with Admin privileges. 2. Launch the Terminal utility from the /Applications/Utilities folder. 3. At the $ prompt, enter the following command to edit the my.cnf file: sudo pico /etc/my.cnf 4. At the Password prompt, enter your user password. The password must be an Admin level password. Installing MySQL on Mac OS X

Installing MySQL on Mac OS X

  • Upload
    others

  • View
    15

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Installing MySQL on Mac OS X

1

User GuidePortfolio SQL Connect

This installation procedure is detailed, and as of this writing, necessary to properly install MySQL 4.1.11, MyODBC 3.51.11 and create your SQL catalog. Due to the nature of open source software, this procedure may be simplified in the future as upgrades are implemented to installers and the source code.

If you purchase a Mac that has Mac OS X Server pre-installed (for example an XServe) MySQL version 4.0 is already installed. SQL Connect requires MySQL version 4.1.11 or higher to run successfully. MySQL version 4.0 must be completely removed before installing version 4.1.11. To read instructions and download a script that removes the earlier version, please visit: http://www.entropy.ch/software/macosx/mysql/remove-old-mysql.html

For the most current MySQL setup and installation instructions please visit: http://www.extensis.com/downloads/

Install MySQL and MyODBC1. Download the most current MySQL installer from

http://www.mysql.com/downloads/

2. Double-click mysql-standard-4.1.11-apple-darwin7.8.0-powerpc.dmg to mount the disk image.

At the time of this writing, this is the most current filename. Your filename may be slightly different.

3. To install MySQL, double-click on the mysql-standard-4.1.11-apple-darwin7.8.0-powerpc.pkg installer package. Follow the installer instructions to complete the installation.

4. When the MySQL installation is complete, double-click MySQLStartupItem.pkg installer package to install it as well.

5. Download the current Connector/MyODBC installer from http://www.mysql.com/downloads/.

6. Launch the installer and follow the instructions. When the Connector/ODBC - Configure Data Source Name dialog box appears, click Cancel. You will create the DSN in a later step.

Configure the database server1. Log in to Mac OS X as any user with Admin privileges.

2. Launch the Terminal utility from the /Applications/Utilities folder.

3. At the $ prompt, enter the following command to edit the my.cnf file:

sudo pico /etc/my.cnf

4. At the Password prompt, enter your user password. The password must be an Admin level password.

Installing MySQL on Mac OS X

Page 2: Installing MySQL on Mac OS X

2

User Guide MySQL Installation and Setup

5. When Pico launches, you are presented with an empty file. Add the following lines to the file:

[mysqld] default-character-set=utf8

[client] default-character-set=utf8

If the /etc/my.cnf file is not empty, but has some configuration settings already specified, just look for the sections [mysqld] and [client] and add the default-character-set=utf8 option to each section if not already present.

6. Press Ctrl-X to exit Pico. At the prompt, press Y to save your changes to the file.

Starting the MySQL Server

Every time you restart the computer, you must restart the MySQL database server.

1. Launch the Terminal application, if is not already open.

2. Use the following command to start the MySQL server:

sudo /Library/StartupItems/MySQLCOM/MySQLCOM start

If prompted, enter your user password. The password must be an Admin level password.

Connecting to the server and creating a database

You must create an initial database for MySQL to serve. Use the following procedure to create and serve databases as needed.

1. Log in to Mac OS X as any user with Admin privileges.

2. Launch the Terminal utility from the Hard Disk/Applications/Utilities folder.

4. Launch the MySQL client with the following command:

sudo /usr/local/mysql/bin/mysql -u root

At the Password prompt, enter your user password. The password must be an Admin level password.

This launches the MySQL client. You should see a mysql> prompt.

Page 3: Installing MySQL on Mac OS X

3

User GuidePortfolio SQL Connect

5. Create the database with the following command. Replace <databasename> with an alphanumeric database name.

create database <databasename>;

Database names are case sensitive. Remember to be case specific when creating and connecting to a database.

6. At the mysql> prompt type the following commands. Substitute dbname with your database name and dbpassword with a password of your choice. Press Return after the semi-colon at the end of each command:

GRANT ALL PRIVILEGES ON dbname.* TO ʻportsql̓ @ l̓ocalhost̓ IDENTIFIED BY d̒bpasswordʼ WITH GRANT OPTION;

GRANT ALL PRIVILEGES ON dbname.* TO ʻportsql̓ @ʼ%ʼ IDENTIFIED BY d̒bpasswordʼ WITH GRANT OPTION;

FLUSH PRIVILEGES;

This creates a new user named portsql and gives them full privileges to your database.

7. When finished creating the database, enter the following command to stop the MySQL client:

quit;

8. To test the new user and connection to the database, enter the following command in the Terminal window:

/usr/local/mysql/bin/mysql -u portsql -p

Enter the password for the portsql user that you created in the previous step.

If the MySQL monitor launches and you see the mysql> prompt, you have successfully connected to the server with the new user.

9. Enter the following command to stop the MySQL client:

quit;

10. It is now safe to close the Terminal window.

Page 4: Installing MySQL on Mac OS X

4

User Guide MySQL Installation and Setup

Add the ODBC drivers and create the DSN file1. Launch the ODBC Administrator utility from the

Hard Disk/Applications/Utilities folder.

2. Click the lock icon in the lower-left hand corner of the ODBC Administrator window and enter your Mac OS X username and password when prompted.

3. From the User DSN tab, double-click the myodbc DSN.

4. In the Data Source Name (DSN) field, enter a name for your new DSN. This will be the name of your Portfolio catalog. Underscores and spaces are not allowed in the DSN name. You may also enter a description if desired.

10. Click the Add button three times to add three new keywords.

11. Double-click each Keyword and Value and edit them to match the following values. Use the database name that your created earlier in the setup process, and the password value for the portsql user.

Keyword Value

SERVER localhost

USER portsql

DATABASE <yourdatabasename>

PASSWORD <portsqlpassword>

Various versions of the MyODBC installer can create default keywords that can interfere with the correct operation of SQL Connect. If by default there are additional keywords in the DSN, remove those keywords.

12. Click OK to save the DSN and associated keywords.

13. Click Apply to apply the newly created DSN and ODBC settings.

Test the ODBC connectionThe final step it to test the ODBC connection, and thus the connection to the SQL database.

1. Launch the Terminal utility.

2. Enter the following command:

/usr/bin/odbctest

The odbctest application was removed from Mac OS 10.4 (Tiger) and replaced with iodbctest.

3. At the prompt, type

?

Page 5: Installing MySQL on Mac OS X

5

User GuidePortfolio SQL Connect

This gives you a list of the current DSN files.

4. Enter the following command to test the connection:

dsn=<dsnname>

Replace <dsnname> with the name of your DSN.

5. At the SQL prompt, enter the following command:

show databases;

A list of current SQL databases is displayed. Your database should now be in this list.

6. Enter the following command to quit odbctest:

quit

7. It is now safe to close the Terminal.

Installing Portfolio SQL ConnectAfter testing the ODBC connection, you can proceed to installing Portfolio Server and the SQL Connect software. See the Portfolio Server User Guide for installation and setup details.

Page 6: Installing MySQL on Mac OS X

6

User Guide MySQL Installation and Setup

Installing MySQL on Windows is a process of installing the MySQL database server, MyODBC, creating a database, creating a DSN and then installing SQL Connect. Use the following procedures to correctly configure MySQL to work with Portfolio 7 on Windows.

Install the MySQL Database Server

These instructions are for version 4.1.7, yet SQL Connect will function with MySQL 4.1.4 and above. Extensis recommends MySQL version 4.1.7 and above due to the inclusion of an installer that eases the process of installation.

1. Download the current version of MySQL from http://www.mysql.com.

The Windows Essentials (x86) or Windows (x86) version can be used.

2. Double-click setup.exe to launch the installer.

3. At the Welcome screen of the Setup Wizard click Next.

4. Choose the Typical option as the setup type and click Next.

5. Click Install.

Installing MySQL on Windows

Page 7: Installing MySQL on Mac OS X

7

User GuidePortfolio SQL Connect

6. At this point you are prompted to create an account on the MySQL.com website. If you would like to do so, choose the appropriate option and follow the instructions.

Otherwise, choose the Skip Sign-up option and click Next.

7. The MySQL Server Database Engine is now installed. At this point the server must be configured, choose the Configure the MySQL Server now option and click Finish.

8. At the Welcome screen of the MySQL Server Instance Configuration Wizard, click Next.

9. Choose the Detailed Configuration option and click Next.

Page 8: Installing MySQL on Mac OS X

8

User Guide MySQL Installation and Setup

10. Choose the Server Machine option and click Next.

11. Choose the database usage type that best describes your installation. If you are unsure, choose the Multifunctional Database option and click Next.

12. Choose a location that will house the database tablespace and click Next. If the current machine will be used to store the Portfolio catalog, the default location will work fine.

13. This step of the Wizard allows you to help optimize the database for the number of concurrent connections that you expect to have to a Portfolio catalog.

If you are not sure how many concurrent users you will have, choose the Online Transaction Processing (OLTP) option and click Next.

Page 9: Installing MySQL on Mac OS X

9

User GuidePortfolio SQL Connect

14. Choose the Enable TCP/IP Networking option and click Next.

15. Choose the Best Support for Multilingualism option and click Next.

16. Extensis recommends running the MySQL server as a service. To do so, check the Install as a Windows Service option and choose a Service Name. It is also recommended to launch the MySQL Service automatically, choose the appropriate option and click Next.

17. In this step you choose enable the root user and choose a password. Check the Modify Security Settings option, then enter and confirm the new root user password. When finished, click Next.

Page 10: Installing MySQL on Mac OS X

10

User Guide MySQL Installation and Setup

18. Click Execute to configure the MySQL instance.

19. Click Finish to close the Wizard.

Install MyODBC

Use the following procedure to install and configure MyODBC on Windows.

1. Download MySQL Connector/ODBC 3.51.11 (or higher) driver installer from http://www.mysql.com

These instructions are for the 3.51.11 version of the MySQL Connector/ODBC driver. SQL Connect requires this version or higher to function properly.

2. Close any programs that you have running.

3. Double click to launch the installer.

4. At the Welcome step of the Installation Wizard, click Next.

Page 11: Installing MySQL on Mac OS X

11

User GuidePortfolio SQL Connect

5. Accept the GNU general public license and click Next.

6. Scan the ReadMe Information and click Next.

7. Click Next to install MyODBC.

8. Click Finish to close the installer.

Page 12: Installing MySQL on Mac OS X

12

User Guide MySQL Installation and Setup

Create the Database and DSN

1. From the Start menu, choose Start > MySQL > MySQL Server 4.1 > MySQL Command Line Client

2. Enter the root user password that you set in step 17 of the MySQL database engine installation.

3. Type the following command to create a database.

create database <databasename>;

Replace <databasename> with the desired name of your SQL database.

4. Type exit to close the command line client.

5. Choose Start > Control Panel.

6. Open Administrative Tools and double click Data Sources.

7. In the ODBC Data Source Administrator, from the System DSN tab, click Add.

8. In the Create New Data Source dialog box, click to highlight the MySQL ODBC 3.51 driver and click Finish.

9. In the Connector/ODBC - Add Data Source Name dialog box, to create the DSN, enter the following information on the Login tab:

Data Source Name — this is the Portfolio catalog name.

Description — general description of the catalog.

Page 13: Installing MySQL on Mac OS X

13

User GuidePortfolio SQL Connect

Server — enter the IP Address of where the MySQL database engine is installed.

User — enter a username that has full access rights to the MySQL database. Often the root user is specified. To do so, enter root in this field.

Password — enter a password for the user above.

Database — choose the databasename that you created in step 3

10. Click Test to test the connection to the database.

After successfully connecting to the database, click OK to accept the Connector/ODBC settings.

11. Click OK in the ODBC Data Source Administrator dialog box.

Finish installation

After you have completed the above steps, you can proceed to installing Portfolio Sever and SQL Connect. For further instructions, see the Portfolio Server User Guide.