Change htdoc and mysql dir

Problems with the Mac OS X version of XAMPP, questions, comments, and anything related.

Change htdoc and mysql dir

Postby dekino » 25. February 2015 20:33

hello everyone.

I wanted to ask if there is a solution to change the directory htdoc and put the files of the sites in another folder.
I've been trying for hours but I can not change anything.
I followed all the guides but xampp always points to the original folder.

Thank you very much

Dekino

xampp 5.6.3
dekino
 
Posts: 5
Joined: 25. February 2015 20:07
Operating System: Mac OS X and Windows 7

Re: Change htdoc and mysql dir

Postby Nobbie » 26. February 2015 15:04

dekino wrote:I followed all the guides but xampp always points to the original folder.


Which guides and what did you try exactly?
Nobbie
 
Posts: 8772
Joined: 09. March 2008 13:04

Re: Change htdoc and mysql dir

Postby dekino » 27. February 2015 20:26

I tried to change de address in this file:
XAMPP/xampfiles/etc/httpd.conf
but nothing change.

The same thing for the mysql my.cnf

The original address remains persistent, if I load in the browser localhost/sitename, this continues to be the original folder htdoc.

any suggestion?

I also tried to change the adress in the config settings in the xampp app.

Thanks!
dekino
 
Posts: 5
Joined: 25. February 2015 20:07
Operating System: Mac OS X and Windows 7

Re: Change htdoc and mysql dir

Postby Nobbie » 27. February 2015 22:25

dekino wrote:I tried to change de address in this file:
XAMPP/xampfiles/etc/httpd.conf!


What do you mean by that? Please be more precisely, we cannot help you if you do not give proper answers. What is meant by "de address"??
Nobbie
 
Posts: 8772
Joined: 09. March 2008 13:04

Re: Change htdoc and mysql dir

Postby dekino » 28. February 2015 10:55

Sorry for my imprecision.
I followed this topic
https://community.apachefriends.org/f/viewtopic.php?f=29&t=69883&p=239408&hilit=mysql+change+dir#p239408

but I'm not able to get results. Maybe I followed the wrong guide.

PS:
What is meant by "de address"??

is a mistake, correct is "the address", sorry. :oops:
dekino
 
Posts: 5
Joined: 25. February 2015 20:07
Operating System: Mac OS X and Windows 7

Re: Change htdoc and mysql dir

Postby Nobbie » 28. February 2015 12:26

Why cant you explain in your own words, what you are doing? The linked thread does not tell how to change htdoc (thats what you wanted). You cannot follow that link, it does not help you.

You said, you followed "all the guides" - which ones else?
Nobbie
 
Posts: 8772
Joined: 09. March 2008 13:04

Re: Change htdoc and mysql dir

Postby dekino » 03. March 2015 20:21

What I would do is to have the database and platform Wordpress on my NAS in the network and I I would like to develop themes for Wordpress with multiple terminals in the same network. To do this I have to be able to set xampp to search for the Database and WP on the NAS.

The other guides that I have tried is in Italian.

Thank You very Much!
dekino
 
Posts: 5
Joined: 25. February 2015 20:07
Operating System: Mac OS X and Windows 7

Re: Change htdoc and mysql dir

Postby Nobbie » 04. March 2015 22:06

dekino wrote:What I would do is to have the database and platform Wordpress on my NAS in the network and I I would like to develop themes for Wordpress with multiple terminals in the same network. To do this I have to be able to set xampp to search for the Database and WP on the NAS.


So this is TOTALLY different from what you told in your first posting! Why??

dekino wrote:The other guides that I have tried is in Italian.


No problem.

P.S.: To keep it short - for MySQL Databases there is an entry in my.ini (on some systems it is called my.cnf instead) and you will find a Section "mysqld" and beyond an entry "datadir" - simply adapt the "datadir" to your needs. BUT: there may be troubles due to local rights management, each process (like MySQLD for example, the MySQL Daemon) is run by a certain UserId and you must grant this User sufficient rights for the "datadir" folder (and as well all files under this folder). This heavily depends on the OS you are running and some more circumstances, so i cannot give you an configuration or hint working "out of the box".
Nobbie
 
Posts: 8772
Joined: 09. March 2008 13:04

Re: Change htdoc and mysql dir

Postby dekino » 05. March 2015 20:46

Thank you very much for your explanations!!
I've opened the my.cnf file and in the section "mysqld" I can't find "datadir". Where I can put the new wordpress address to load?

Below you can find the contents of my "my.cnf"

Thank you for your support!
:)

Code: Select all
# Example MySQL config file for medium systems.
#
# This is for a system with little memory (32M - 64M) where MySQL plays
# an important part, or systems up to 128M where MySQL is used together with
# other programs (such as a web server)
#
# You can copy this file to
# /etc/my.cnf to set global options,
# mysql-data-dir/my.cnf to set server-specific options (in this
# installation this directory is /Applications/XAMPP/xamppfiles/var/mysql) or
# ~/.my.cnf to set user-specific options.
#
# In this file, you can use all long options that a program supports.
# If you want to know which options a program supports, run the program
# with the "--help" option.

# The following options will be passed to all MySQL clients
[client]
#password   = your_password
port      = 3306
socket      = /Applications/XAMPP/xamppfiles/var/mysql/mysql.sock

# Here follows entries for some specific programs

# The MySQL server
[mysqld]
user = mysql
port=3306
socket      = /Applications/XAMPP/xamppfiles/var/mysql/mysql.sock
skip-external-locking
key_buffer = 16M
max_allowed_packet = 1M
table_open_cache = 64
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M

# Where do all the plugins live
plugin_dir = /Applications/XAMPP/xamppfiles/lib/mysql/plugin/

# Don't listen on a TCP/IP port at all. This can be a security enhancement,
# if all processes that need to connect to mysqld run on the same host.
# All interaction with mysqld must be made via Unix sockets or named pipes.
# Note that using this option without enabling named pipes on Windows
# (via the "enable-named-pipe" option) will render mysqld useless!
#
#skip-networking

# Replication Master Server (default)
# binary logging is required for replication
# log-bin deactivated by default since XAMPP 1.4.11
#log-bin=mysql-bin

# required unique id between 1 and 2^32 - 1
# defaults to 1 if master-host is not set
# but will not function as a master if omitted
server-id   = 1

# Replication Slave (comment out master section to use this)
#
# To configure this host as a replication slave, you can choose between
# two methods :
#
# 1) Use the CHANGE MASTER TO command (fully described in our manual) -
#    the syntax is:
#
#    CHANGE MASTER TO MASTER_HOST=<host>, MASTER_PORT=<port>,
#    MASTER_USER=<user>, MASTER_PASSWORD=<password> ;
#
#    where you replace <host>, <user>, <password> by quoted strings and
#    <port> by the master's port number (3306 by default).
#
#    Example:
#
#    CHANGE MASTER TO MASTER_HOST='125.564.12.1', MASTER_PORT=3306,
#    MASTER_USER='joe', MASTER_PASSWORD='secret';
#
# OR
#
# 2) Set the variables below. However, in case you choose this method, then
#    start replication for the first time (even unsuccessfully, for example
#    if you mistyped the password in master-password and the slave fails to
#    connect), the slave will create a master.info file, and any later
#    change in this file to the variables' values below will be ignored and
#    overridden by the content of the master.info file, unless you shutdown
#    the slave server, delete master.info and restart the slaver server.
#    For that reason, you may want to leave the lines below untouched
#    (commented) and instead use CHANGE MASTER TO (see above)
#
# required unique id between 2 and 2^32 - 1
# (and different from the master)
# defaults to 2 if master-host is set
# but will not function as a slave if omitted
#server-id       = 2
#
# The replication master for this slave - required
#master-host     =   <hostname>
#
# The username the slave will use for authentication when connecting
# to the master - required
#master-user     =   <username>
#
# The password the slave will authenticate with when connecting to
# the master - required
#master-password =   <password>
#
# The port the master is listening on.
# optional - defaults to 3306
#master-port     =  <port>
#
# binary logging - not required for slaves, but recommended
#log-bin=mysql-bin


# Point the following paths to different dedicated disks
tmpdir = /Applications/XAMPP/xamppfiles/temp/mysql
#log-update    = /path-to-dedicated-directory/hostname

# Uncomment the following if you are using BDB tables
#bdb_cache_size = 4M
#bdb_max_lock = 10000

# Comment the following if you are using InnoDB tables
#skip-innodb
innodb_data_home_dir = /Applications/XAMPP/xamppfiles/var/mysql/
innodb_data_file_path = ibdata1:10M:autoextend
innodb_log_group_home_dir = /Applications/XAMPP/xamppfiles/var/mysql/
# You can set .._buffer_pool_size up to 50 - 80 %
# of RAM but beware of setting memory usage too high
innodb_buffer_pool_size = 16M
# Deprecated in 5.6
#innodb_additional_mem_pool_size = 2M
# Set .._log_file_size to 25 % of buffer pool size
innodb_log_file_size = 5M
innodb_log_buffer_size = 8M
innodb_flush_log_at_trx_commit = 1
innodb_lock_wait_timeout = 50

[mysqldump]
quick
max_allowed_packet = 16M

[mysql]
no-auto-rehash
# Remove the next comment character if you are not familiar with SQL
#safe-updates

[isamchk]
key_buffer = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M

[myisamchk]
key_buffer = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M

[mysqlhotcopy]
interactive-timeout

!include /Applications/XAMPP/xamppfiles/mysql/my.cnf                                                             
dekino
 
Posts: 5
Joined: 25. February 2015 20:07
Operating System: Mac OS X and Windows 7

Re: Change htdoc and mysql dir

Postby Nobbie » 05. March 2015 22:50

If there is no datadir entry, simply create one.

And Please, please, please - use Google for further help. Dont ask for any byte and any letter - try to help yourself. This is really not that difficult as you might think, simply "go for it". Google and Wikipedia knows everything, it is on you to use it!
Nobbie
 
Posts: 8772
Joined: 09. March 2008 13:04

Re: Change htdoc and mysql dir

Postby Dave003 » 03. May 2016 15:18

Nobbie wrote:If there is no datadir entry, simply create one.

And Please, please, please - use Google for further help. Dont ask for any byte and any letter - try to help yourself. This is really not that difficult as you might think, simply "go for it". Google and Wikipedia knows everything, it is on you to use it!


I have been googing for seven hours straight and have not found a single website that shows you what line in what file (I assume it is my.cnf?) that you are supposed to add datadir.

While what you are talking about is true for googling stuff for windows users it is most definitely not true for mac users.

Apache already points to the right directory, but this is useless if mysql's default cant be changed. If I add the datadir entry mysql wont start, if I comment out that line MySQL is fine again.
Code: Select all
# Example MySQL config file for medium systems.
#
# This is for a system with little memory (32M - 64M) where MySQL plays
# an important part, or systems up to 128M where MySQL is used together with
# other programs (such as a web server)
#
# You can copy this file to
# /etc/my.cnf to set global options,
# mysql-data-dir/my.cnf to set server-specific options (in this
# installation this directory is /Applications/XAMPP/xamppfiles/var/mysql) or
# ~/.my.cnf to set user-specific options.
#
# In this file, you can use all long options that a program supports.
# If you want to know which options a program supports, run the program
# with the "--help" option.

# The following options will be passed to all MySQL clients
[client]
#password   = your_password
port      = 3308
socket      = /Applications/XAMPP/xamppfiles/var/mysql/mysql.sock

# Here follows entries for some specific programs

# The MySQL server
[mysqld]
datadir = /Users/MyUsername/OneDrive/WebDev/mysql
user = mysql
port=3308
socket      = /Applications/XAMPP/xamppfiles/var/mysql/mysql.sock
skip-external-locking
key_buffer = 16M
max_allowed_packet = 1M
table_open_cache = 64
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M


# Where do all the plugins live
plugin_dir = /Applications/XAMPP/xamppfiles/lib/mysql/plugin/

# Don't listen on a TCP/IP port at all. This can be a security enhancement,
# if all processes that need to connect to mysqld run on the same host.
# All interaction with mysqld must be made via Unix sockets or named pipes.
# Note that using this option without enabling named pipes on Windows
# (via the "enable-named-pipe" option) will render mysqld useless!
#
#skip-networking

# Replication Master Server (default)
# binary logging is required for replication
# log-bin deactivated by default since XAMPP 1.4.11
#log-bin=mysql-bin

# required unique id between 1 and 2^32 - 1
# defaults to 1 if master-host is not set
# but will not function as a master if omitted
server-id   = 1

# Replication Slave (comment out master section to use this)
#
# To configure this host as a replication slave, you can choose between
# two methods :
#
# 1) Use the CHANGE MASTER TO command (fully described in our manual) -
#    the syntax is:
#
#    CHANGE MASTER TO MASTER_HOST=<host>, MASTER_PORT=<port>,
#    MASTER_USER=<user>, MASTER_PASSWORD=<password> ;
#
#    where you replace <host>, <user>, <password> by quoted strings and
#    <port> by the master's port number (3306 by default).
#
#    Example:
#
#    CHANGE MASTER TO MASTER_HOST='125.564.12.1', MASTER_PORT=3306,
#    MASTER_USER='joe', MASTER_PASSWORD='secret';
#
# OR
#
# 2) Set the variables below. However, in case you choose this method, then
#    start replication for the first time (even unsuccessfully, for example
#    if you mistyped the password in master-password and the slave fails to
#    connect), the slave will create a master.info file, and any later
#    change in this file to the variables' values below will be ignored and
#    overridden by the content of the master.info file, unless you shutdown
#    the slave server, delete master.info and restart the slaver server.
#    For that reason, you may want to leave the lines below untouched
#    (commented) and instead use CHANGE MASTER TO (see above)
#
# required unique id between 2 and 2^32 - 1
# (and different from the master)
# defaults to 2 if master-host is set
# but will not function as a slave if omitted
#server-id       = 2
#
# The replication master for this slave - required
#master-host     =   <hostname>
#
# The username the slave will use for authentication when connecting
# to the master - required
#master-user     =   <username>
#
# The password the slave will authenticate with when connecting to
# the master - required
#master-password =   <password>
#
# The port the master is listening on.
# optional - defaults to 3306
#master-port     =  <port>
#
# binary logging - not required for slaves, but recommended
#log-bin=mysql-bin


# Point the following paths to different dedicated disks
tmpdir = /Applications/XAMPP/xamppfiles/temp/mysql
#log-update    = /path-to-dedicated-directory/hostname

# Uncomment the following if you are using BDB tables
#bdb_cache_size = 4M
#bdb_max_lock = 10000

# Comment the following if you are using InnoDB tables
#skip-innodb
innodb_data_home_dir = /Applications/XAMPP/xamppfiles/var/mysql/
innodb_data_file_path = ibdata1:10M:autoextend
innodb_log_group_home_dir = /Applications/XAMPP/xamppfiles/var/mysql/
# You can set .._buffer_pool_size up to 50 - 80 %
# of RAM but beware of setting memory usage too high
innodb_buffer_pool_size = 16M
# Deprecated in 5.6
#innodb_additional_mem_pool_size = 2M
# Set .._log_file_size to 25 % of buffer pool size
innodb_log_file_size = 5M
innodb_log_buffer_size = 8M
innodb_flush_log_at_trx_commit = 1
innodb_lock_wait_timeout = 50

[mysqldump]
quick
max_allowed_packet = 16M

[mysql]
no-auto-rehash
# Remove the next comment character if you are not familiar with SQL
#safe-updates

[isamchk]
key_buffer = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M

[myisamchk]
key_buffer = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M

[mysqlhotcopy]
interactive-timeout

!include /Applications/XAMPP/xamppfiles/mysql/my.cnf
Dave003
 
Posts: 9
Joined: 07. December 2006 13:12

Re: Change htdoc and mysql dir

Postby Nobbie » 03. May 2016 21:26

Dave003 wrote:I have been googing for seven hours straight and have not found a single website that shows you what line in what file (I assume it is my.cnf?) that you are supposed to add datadir.


It took me 2 seconds to google this website: https://dev.mysql.com/doc/refman/5.5/en ... ation.html

Dave003 wrote:While what you are talking about is true for googling stuff for windows users it is most definitely not true for mac users.


See above.
Nobbie
 
Posts: 8772
Joined: 09. March 2008 13:04


Return to XAMPP for Mac OS X

Who is online

Users browsing this forum: No registered users and 4 guests