Monday, September 9, 2013
Making
Slave MySQL Server
Setting up a
slave MySQL server is a very easy process, that is, if you are aware of the
actual commands and the medium which is required to execute the commands. MySQL server is used to run different
commands through a suitable medium for carrying out different actions that cannot
be done otherwise. These commands are also useful for keeping the data on your
computer secure. It is important to keep a proper back up of the precious data
your system is holding. By having a backup it will become easy to restore the
data at any required point.
1.
These
points are going to be helpful for those who are basically working from home
and are unaware of the importance of the fact, that how important it is to keep
a backup and your information protected.
2.
Most
of the workplace computers have data backup options that help prevent
accidental loss of data. In case it is lost it can be recovered easily with the
help of different commands that are used to activate the backup.
3.
This
tells us that the importance of MySQL
database is quite strong if you want to make sure that your data can be
transferred from one place to another in any event of loss. Workplace managers make sure, that their employees
are aware of the importance of the MySQL server and how it can save from a
great loss.
·
Working
of salve MySQL server
Slave MySQL
server enjoys considerable popularity in terms of functioning and user
reliability. But it is more important to know the actual functions of the
server and how it acts a major backup tool. One important question which might
come in the mind of several programmers is that, will this server serve as an
online backup tool or an offline backup tool. There is an option to choose
online medium or offline medium for the protection of data. Most of the users
adopt the online backup strategy in order to deal with any downtime
issues. There are several advantages of
an offline backup system as it offers less number of errors and there is no
need to worry about the running transactions, orphaned processes or table locks
or anything else that can create errors and disrupt the normal functioning.
·
Characteristics
of slave MySQL server
Those users
who can easily afford downtime and have slave replication then the offline
backup method is best for them. Database is created with the help of data dump
option that helps in several other processes. It can be regarded as an
expensive exercise but in the end all the efforts will be worth it. The size of
files will also get large when an additional SQL syntax is added. But this is
not a matter of concern as it does not harm the system or functioning of other
programs. It is important to know all of
the steps that are required to set up a Salve MySQL server , as a single command that is entered wrong will
disrupt the process of data migration.
Installing MySQL with Apache 2.x
For the sake of local development and testing, Apache and MySQL are installed on the computer windows in order to serve for various purposes.
Installing the latest apache series:
·
For
the installation of the latest Apache available few simple steps are followed.
·
While
going to the official website of Apache one can search for the best available
version of Apache 2.x. One will encounter with the win file containing the
setup of Apache version. The version has to be further downloaded on the
computer.
·
Run
the file from the desired destination and keep on moving next until it asks
about the server information.
·
In
server information, local host information has to be given while one can give
any email address when required for admin email.
·
Change
the name of the destination folder and keep on moving until the installation is
done.
·
As
soon as the installation is complete, the file will start running on the
screen. A dos window might also open on the computer until the Apache is running
on the computer.
·
The
next step is the creation of index.hmtl file that can be made with simple steps
and has to be saved in Apache folder. Once the file is saved open it for
display if the apache is running the step is successful otherwise repeat the
process.
Installing MySQL
·
Go
to the official page of installing MySQL and scroll down to find the concerned
link. From link find the desired file and download it to the computer.
·
Unzip
the file to some folder and run the necessary setup from given destination.
·
Once
the installation is complete, one has to create the username and password for
further proceedings.
·
The
username and password can be modified with php later for further editing.
MySQL and Apache:
Apache helps
in running the various modules of the MySQL and if Apache fails to work with
the specific version that could result in using the previous MySQL libraries.
Recompiling of all modules using MySQL will be a better solution to the
problem. For the effective use of MySQL files with apache one needs to
understand the importance of availing the options for authentication to apache.
There are many online packages available that provide the source that will be
helpful in upgrading the version of the program and further helps in verifying
the problems. These packages vary with the system it is designed for; from
Linux to the MAC system. The basic programs work for the installation of
various programs that requires the selected versions of MySQL and apache.
Failure in the coordination of the two files will result in the failure of the
installation. The settings stand for the security as well as requirements for
the concerned activity for the web server.
In short
MySQL ad apache works in coordination with their related versions and provides
the database that has to be run in order to perform the specific function on
the computer. These stand for the efficient components on the web server.
Import/Export MySQL
Generally
speaking importing and exporting data in the MySQL is not a difficult task and
there are three different ways specified for the efficient working. The first
method is to perform it through graphical means with the help of phpMyAdmin while the method is not highly
recommended in case of uploading heavy files on system. The next method is the
utilization of the SSH tunnel in which a third party is used to execute the
importing function for the system. The last method is to make use of the
command line client for MySQL through the SSH connection.
As there are
different ways used to develop the backup or restoring for the MySQL yet there
are some limitations in each method. The best way recommended is to perform the
task locally which helps in dumping of data on the disk in a much faster speed.
By simply using the dumping procedure as well as utilities one can perform the
task in much better time and error free method.
Import data of MySQL
One of the
widely used methods for restoring or importing data on the server is to start
creating with the username for MySQL. Once the account information is made that
includes a database, password and username, one is ready for the further
proceedings.
·
Upload
the dump file of the SQL to the account from the database. Majority files can
be recognized with .sql extensions.
·
The
file will contain the necessary statements and the tables on which the action
of reinserting will be performed.
·
After
uploading of the file, a SSH account is required and a special command is run
to make it function.
·
Replace
the mysqluser with the username created by you while the statement of mysqldb
will be substituted with the database of the sql created. While the last
statement of dbfile.sql will be replaced with the name of the respective sql
dump file location.
·
A
password will be needed for the necessary action and once it matches with the
system, it will immediately load the data. Any error in the dump file path will
result in failure in uploading of the file.
Export data for MySQL
·
Exporting
the data is convenient when compared to the steps followed for importing. Yet
the first step for both the tasks remains the same as one need to create the
SSH account.
·
Once
the SSH account is generated we will take the same example of the previous
statement. The command that has been used to initiate the process earlier.
·
The
next step is to provide the username and password to the system that will
further helps in replacing the required statement.
·
As
soon as the password matches with the system, there will be a file created that
contains the data on the home directory. Further FTP can be sued in order to
download the given file.
·
If
the file is not to be used again after downloading, it is highly recommended to
delete it on order to not to be used for the server in future.
What is MySQL?
MySQL is the
best source to provide database system working as a server and further provide
access to other databases. SQL is the abbreviation of Structured Query
Language. In simple words, MySQL helps in creating a structural database on the
web for sake of either storing data or an access to automotive procedures. With the help of such system one can create a
number of magnificent projects on the web. MySQL is also one of the open
sources that are free to use as it is licensed with general public license GPL.
The system is supported by the web host and is further associated with the
Linux servers.
How it is used?
MySQL is one
of the widely used choices for creating the database on the web. Some of the
renowned sites have used it as the database management system that includes
YouTube, twitter and Facebook. The choice of the system works as a database to
be used in web applications and is considered one of the major components of
LAMP. MySQL is although a bit complex in use but easy to be built and can be
manually installed. After special customizations it is installed from binary
package. Once the system is installed after simple steps, system often require
configuration to adjust further settings related to security.
In what way it is better than other
system?
The system
provides the multiple storage engines in which one can manually select the
efficient storage for the web use. The system provides many features storage
engines that each carries its own features. While creating the table on the web
one use the complicated statements of MySQL for the efficient working. Once the
tables are created the major part of the project is done, as the speed of the
system as well as reliability is much standardized when compared to other
systems. The system works best when a webpage is receiving a record number of
hits each day.
The tables
of the system provide the real characters of the data type that provide
convenience in use. When used LongText data type, one can use billions of text
characters, while the Longblob data type provides the functional advantage of
holding many characters at the same time. The feature of Bigint data type
provides the ultimate storage of countless digits used by the multi user. These
features are considered to be the major reason behind the use of the system by
many renowned websites that receives a record number hits by the user each day.
As MySQL is
free to use being licensed with GPL, the support for the use of the system can be
obtained from the manual available on the official website while further
support is also available on the wide level at many forums and IRC channels.
More advanced support is provided by ORACLE on paid services. Many versions of
the system are released and there are further advanced system ready to be
released due to the wide use of the system by many experts.
Most
Common Shell Commands
Here we are going to discuss a few common shell commands that are being
used by the programmers to enable different functions. Beginners are confused
about the set of commands that can be used and the command box through which
they can execute their commands. All of the shell commands use s sensible and a
logical pattern to be executed. All of the shell commands are very short and
only include three or four letters. Shell commands that are used frequently
have been shortened to ease their usage criteria. Now we will describe a few
simple shell commands that will get you going.
·
Man command
Also known as manual command, it is used to help users with different
problems that can be faced while using Linux operating system. It is a built in
command and needs not to be modified. The man commands pages are not the
standalone guidelines for the beginners but can be used as a reference to mix
the reference material which you learned somewhere else.
·
Info command
Info command is a very useful command, which is also used as a reference
source for gaining help in different matters of Linux operating system.
1.
Troubleshooting suggestions and GNU information can
be gained with the help of info command. It is somewhat different from man
command as in info command you can make use of the hyperlinks for easy and
secure browsing.
2.
You can access the required material easily as
there are several shortcuts available for scrolling through different pages.
·
Date command
By looking at the name of this command you will get an idea about the
working of this command. When you enter this command on your system you will
come to know about the current date and time on your system. If you use cal command along with date
command it will show the calendar. You can look into the calendar of the
current month or choose a special date where the calendar can take you to.
·
Is command
Is command is a basic command that will display the different contents
which are present in a directory that you have chosen already. It means that
you will be able to see all of the files which are present in a specific
directory with the help of this simple command. This command has different
switches that can be used to modify its functionality and behavior. You can use
different commands with the basic Is command to get more detail and description
of the content which is present in the directory, or even a specific directory
for which you are looking. Hidden files in any directory can also be viewed if
you use another command with the basic Is command.
·
Cat command
Cat command can be used for viewing all of the text which is present in
any simple file. This simple command comes handy if you are dealing with basic
text files and want to see the text which is present in these files.
All of these commands are quite simple and can be placed to execute
different actions according to your requirements.
Overview of phpMyAdmin
PhpmyAdmin
can be described as the most popular application, which is being used for the
MySQL database management. Basically it is a free management tool that has been
developed in PHP and it is a very useful tool. As with the help of this
application you can easily export, import, delete, drop, alter or create a
MySQL database table. Not only this, but you can also run various MySQL
queries, check tables, optimize, repair, execute different database commands
and even change collation.
·
The different unique features of
PhpMyAdmin are:
1.
It supports a user friendly interface
for different web based applications
2.
As told above it works as a support for
many MySQL functions which include dropping, creating, browsing, copying and
altering different databases, views, indexes, tables and fields, executing
MySQL queries, managing the stored functions and procedures.
3.
Importing data from the SQL and CSV
files
4.
Exporting data to different formats
including the XML, SQL, PDF, CSV, IEC/ISO 26300 – LATEX, Spreadsheet and Open
Document Text and MS Word, MS Excel
5.
Searching globally in any database or a
possible subset of it
6.
Several more features
·
Requirement of PhpMyAdmin
There
are several blogs, making use of the export and import tools in the WordPress
to handle different requirements of their websites. In case of an emergency and
to repair your blog you might need the WP-DB-Backup tool. But for the backup of
your data you will require the phpMyAdmin. Importance of phpMyAdmin can be
judged from that factor that it helps in handling the MySQL server, as all of
the programs are basically series of different MySQL and databases which manage
them. We can describe SQL as the main language that is being inside different
databases. So the important fact over here is that phpMyAdmin allows handling
different databases in a very easy manner. phpMyAdmin is basically a PHP script
that allows users to interact directly with their MySQL database. Raw data stored in MySQL database can be
accessed through the phpMyAdmin facility easily.
·
Location of phpMyAdmin
To
locate your phpMyAdmin, you need to login to the back office or the cPanel.
After you login you will see different boxes where similar programs are being
grouped together. You have to select the box which shows databases and there
you will be able to see the phpMyAdmin. Host control panels like Plesk and
cPanel might have the phpMyAdmin installed earlier, so there is not much work
left to do. Basically it is linked with the database page and to make sure, it
is properly linked or not, you can ask your host for the availability.
·
Location of database
After
accessing you can click on Databases which is located under the localhost or
the MySQL. If you have several databases you will see a list of different
databases. It depends on you, which one you actually need and then you can
click on it.
You
must keep in mind that phpMyAdmin allows direct interaction with the different
databases, so it means any changes you are going to make will take an immediate
effect. You cannot modify the changes once they are made in the database, so
always work with caution while using both of the elements together.
Setting up Master MySQL Server
Setting up a master MySQL server is
an easy process. But for the beginners this process might get tricky as they do
not know how to place different commands. Apart from knowing the exact and
accurate commands required for executing different actions they also need to be
typed correctly, as any wrong command will not let a required action to take
place. It will actually prevent MySQL from carrying out the action further in
case a wrong command has been detected. So it is important to learn and enter
the exact commands for this purpose.
1.
To initiate the
process first of all you need to install MySQL on the Windows Dedicated server
2.
After installing
MySQL you can start the program and enter the required commands
3.
You will start
MySQL with the help of Windows Command Line
4.
To make this process
successful you need to know the following steps
Note: the steps that we are going to
discuss over here can be used easily on any version of Windows, as there are no
special instructions or guidelines that require MySQL to become operational on
Windows.
·
Getting started
First of all open the windows command
box which is also called as the DOS Windows. After you have opened the console
window you can start MySQLD server with the help of special commands.
The exact path of the MySQLD server
will actually depend on the server of Windows and on the path where MySQL has
been installed. You can also stop the functioning of MySQL sever by entering a
simple command.
1.
It is important to
note that if there is a password required then you need to bring the p(password)
option on the mysqladmin, which will allow your access to the root use account.
With the help of simple commands
MySQL administrative utility will come into action and inform the mysqladmin
server, to establish a link with the main server and as a result it is ordered
to shut down or discontinue its activity.
2.
It is important to
note that, the users accessing the MySQL grant system are basically independent
and free from the influence of any other users that login Windows for different
purposes.
·
MySQL web server
In case you are facing difficulties
in initiating the MySQL server then you need to have a look at the error log,
which will tell you about the different errors that are stopping the action.
You will also know if any action has been dropped by the server due to certain
limitations and this will eventually help you out in determining the actual
problem. All of the errors are recorded in the system files and you can easily
access them at any time.
There is another process for
initiating MySQL server with the help of mysqld console. By using this command
you will be able to successfully run the program and start the server. By
entering this command your screen will display some useful information, which
will serve as a guideline to prevent further errors from taking place.
Simple MySQL commands
MySQL is a
database system used by many sites in order to maintain a functional database
for web use. The system is easy to install and further used by doing simple
configuration to the system. Below are
some of the simple commands to be used in MySQL that further provides easy
functioning in the system.
The commands
used on MySQL helps in the direct interaction with the database on the server.
Such commands are most of the time useful in sudden requirements of the
application in order to create a database or the tables related to it. By
loading the sql script one is ready to create the given requirements. For
accessing any command line one has to execute the command by entering the
password.
Some simple commands in MySQL
·
For
creating the users of the table simple commands are useful.
·
In
case of user nickname are required only with their concerned favorite number,
some easy to use commands can do the desired task.
·
For
the nicknames availed if provided with pair of socks that are less than 10 and
if the favorite number specified is more than 100 then the command will specify
the detail in it.
·
For
inserting the row of data into the system table, an easy to use command of
MySQL will provide the best solution.
·
For
if the row of the data has the password missing the command is somewhat same as
the one recommended for creating the password for the user table.
Common statements to be used:
For more
complex type of commands there are different statements and clauses are used
that helps in generating the commands. Some of the mostly used statements and
clauses are
ALTER DATABASE
ALTER VIEW
ANALYZE TABLE
CACHE INDEX
CHECK TABLE
COMMIT
CREATE INDEX
CREATE DATABASE
CREATE VIEW
DELETE
DROP DATABASE
DROP INDEX
DROP USER
EXPLAIN
GRANT
INSERT
KILL
LOAD DATA INFILE
LOCK TABLES
RENAME TABLES
RESET MASTER
RESTORE TABLE
SET PASWORD
SHOW COLUMNS
SHOW CREATE TABLE
An example of complete MySQL command:
Apart from
these famous statements there is still much to learn regarding the string
functions of the system as well as functional aspect of date and time. To
explain more about some simple commands let us take an example of a complete
set of command performing the desired function.
·
Replacing
the statements
The action
of replacing the item is performed in a row. The action of replacement is more
dependent on the id as in order to REPLACE effectively one has to add the
column of PRIMARY. Once the primary column has been set as id the system will
be familiar as to which row the necessary action has to be performed. Consequently if the id is not specified
system will have no information of which row one has intended to bring changes.
In the
statements where id is not specified to the system it will act more like an
INSERT action. In simple words if the primary row is specified the changes will
be made only in concerned row.
Subscribe to:
Posts (Atom)
Popular Posts
-
What is MySQL? MySQL is the best source to provide database system working as a server and further provide access to other databases...
-
Most Common Shell Commands Here we are going to discuss a few common shell commands that are being used by the programmers to enabl...
-
What is Shell Scripting? For those who do not have a programming background must be unaware of the basics of different operating sy...
-
Making Slave MySQL Server Setting up a slave MySQL server is a very easy process, that is, if you are aware of the actual commands and...
-
Overview of phpMyAdmin PhpmyAdmin can be described as the most popular application, which is being used for the MySQL database manage...
-
Simple MySQL commands MySQL is a database system used by many sites in order to maintain a functional database for web use. The sys...
-
What is phpMyAdmin? phpMyAdmin is a script made in PHP that is basically used for providing the interaction of the user with the M...
-
Installing MySQL with Apache 2.x For the sake of local development and testing, Apache and MySQL are installed on the computer win...
-
Import/Export MySQL Generally speaking importing and exporting data in the MySQL is not a difficult task and there are three differe...
-
Setting up Master MySQL Server Setting up a master MySQL server is an easy process. But for the beginners this process might get tr...