39

Use psql: psql -f thefile.sql targetdatabase You may need to specify additional parameters, like username to connect as, host to connect to, etc.


25

If you already logged in to database then you can use meta commands like db=# \i or \include filename For more info see doc


25

Shorter answer: You could simply erase or move the httpd.conf file you adjusted and then run the following command and it will be reinstalled: yum reinstall httpd Longer answer: But if you want to be a bit more methodical about it, you could follow the ideas and concepts shown on this page. First, check what package installed httpd.conf by running this ...


20

CentOS 6 is based on RHEL 6, which was released in 2010. Within a major release, the goal is compatibility and not introducing breaking changes as the target audience is enterprises that value stability over features. As you can see from the version history, they don't introduce new kernel versions within a major release (but some fixes are backported), so ...


14

The following should do the trick : setfacl -x u:userXXX home/userYYY/private/ And as far as I know, where ACL are enabled, a + sign is shown.


11

As discovered in the extended discussion through comments, your system is broken. I suggest reinstalling the system completely or at least the broken packages. To have /sbin/service again run yum reinstall initscripts. I don't recommend it, but if you want to reinstall all the packages that fail verification, run: yum reinstall $(rpm -q --qf '%{NAME}\n' -...


11

If you want something interactive, try : atop - launch it and press 'm' (memory usage) and 'p' (group by process name). If you want something scriptable, there's something a bit like the below - although it's not doing quite what you've asked for (PPID 1), but you can group based on e.g. process name using awk - ps -eo pmem,vsize,cmd | grep -v '\[' | awk '...


9

To update PHP 5.3.3 to 5.4.4: wget http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm rpm -ivh epel-release-6-8.noarch.rpm wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm rpm -Uvh remi-release-6*.rpm yum --enablerepo=remi upgrade php-mysql php-devel php-gd php-pecl-memcache php-pspell php-snmp php-xmlrpc php-xml


8

If you run getent group group01 you should see a list of all members of that group.


7

The service command resides in the sbin directory - make sure it exists at /sbin/service If you are root, then according to this mailing list, you may need to make sure it's on your path: Centos5 - Service Command Not Present. You may also check out a similar function called chkconfig, since it can activate services as well. CentOS - chkconfig The links ...


6

The difference between semange and chcon is that chcon is "temporal" if the system gets relabel the contexts present in a file / directory will be lost, using semanage makes selinux contexts persistent. In order to semanage to work, you must provide the full path to the file or directory, that is why semanage fcontext -a -t public_content_rw_t upload/ does ...


6

The normal address is http://isoredirect.centos.org/centos/6.5/isos/ but the CentOS project is no longer hosting any direct downloads for it (it's expensive!); you will have to use a mirror. When you go to the above url, you will have to choose between a folder for x86 (i386), and a folder for x86-64, when you click into that folder you will be re-directed ...


6

Issue solved : https://jira.mongodb.org/browse/SERVER-18448 there were some files corrupted after updating those files "sizeStorer.wt, WiredTiger.turtle, WiredTiger.wt" able to repair database using sudo mongod --repair --dbpath /database/db --storageEngine wiredTiger before restart check permissions of all files present in database and after updating ...


6

I'll provide the basic service script but anyone is invited to improve my answer. This is for CentOS 6.10 The service scripts are placed in this directory: /etc/rc.d/init.d There's a template provided by the system, open the file with your editor of choice (example vi): vi /usr/share/doc/initscripts-*/sysvinitfiles Here's a simple example of my kafka ...


5

I am adding this it might be useful who try to execute *.sql place where PostgreSQL server located in a difference place. psql -h localhost -d userstoreis -U admin -p 5432 -a -q -f /home/jobs/Desktop/resources/postgresql.sql These are the usage of each parameter -h PostgreSQL server IP address -d database name -U user name -p port which PostgreSQL ...


5

Try leaving off the "root@" portion of the -R argument: ssh -v -R hostname:19999:localhost:22 root@hostname With the four-parameter version of -R, the four parameters are the address and port to listen for connections on the remote host, and the address and port to forward to from the local host. You're giving a value of "root@hostname" as the remote bind ...


5

Here is my complete solution: First I visually audited the audit.log. To catch the right things and only the right things, I used audit2allow to create a policy and type enforcement rule. grep mount /var/log/audit/audit.log | audit2allow -R -M mounts3fs I grep for mount so I only get the right things. This created a mounts3fs.pp and mounts3fs.te file. ...


5

I accidentally only increased the motherboard size (I'm not sure why it worked the first time when I increased it to 8G) To solve my issue: I went to > Settings > Storage and created a new Hard Drive under Controller:SATA. When I rebooted the machine, I ran sudo gparted (or lsblk -f) and got the new HD name. I was then able to use the instructions here ...


4

This could happen because of many reasons..Some of the possible reasons are the following Check the selinux context of the index file. Try loading the page after setting selinux to permissive. Check permissions of the index file. It should be readable to others Have you restarted httpd after making changes? . Check the DirecoryIndex in your httpd.conf. In ...


4

Let us assume the ISO is already burnt into a DVD, or the ISO is present as a file on your file system. First, we need to mount it. The preferred mount point to mount it is /media/CentOS, because yum is configured to look for repositories from this location by default while installing packages from DVD. The steps below describe how to mount the ISO (whether ...


4

Many corporate firewalls block ICMP - which is the protocol is used by ping utility. Better solution for this is to try TCP connection to google.com:80. Easiest way to check for basic internet connectivity in shell script is utility nc (it should be easily available on most Linux systems): nc -w 3 -z google.com 80 echo $? This means check if port 80 on ...


4

Besides # fc-list You can find all true type fonts in your disk with find: (caution: it can take long time to process) # find / -type f -name "*.ttf"


4

Apart from what Renan mentioned, you can switch to another runlevel by simply executing sudo init [level-number] -- this is temporary, when you reboot, you get to your default, configured in /etc/inittab. If you don't want to see splash screen, you need to replace kernel param rhgb with text in boot menu. To make it permanent, edit /boot/grub/grub.conf.


4

I had a similar problem, but all I needed to do was edit the network-script to yes for onboot and restart the network. Edit the network-script vi /etc/sysconfig/network-scripts/ifcfg-enp0s3 bla bla=bla ... onboot=yes Restart network systemctl restart network


4

This is believed to be caused by a benign defect in the USB controller that the hard drive uses. Note that this is not actually an error code but an "abnormal success" code. This means the operation was successful, and the kernel knows it completed successfully, but the controller reports for informational purposes that it had to retry the operation or ...


4

The problem was that PuPHPet.com's CentOS vagrant boxes no longer come with a default set of firewall rules. So, in order to resolve this, boot up the VM using VirtualBox (or whichever hypervisor you are using), then modify and save /etc/sysconfig/ptables to allow your desired services. In my personal opinion, the best way to edit your iptables' rules is by ...


4

Or, is there a way to direct a process to use disk-mapped RAM so there's much more available and it doesn't use system RAM? Yes, It's called the swap drive. You probably already have one. If you're worried about running out of RAM then increasing this is a good place to start. It works automatically though so there is no need to do anything special. I ...


4

yum clean packages Should clear the cache


4

@JakeGould's answer is great but to be more explicit: yum reinstall httpd will only restore missing files, not the changed configs. By moving/removing the old configuration file first, that allowed yum reinstall to restore the file. Alternatively, you could use the method shown here: How to force `yum reinstall` to overwrite changed files in a `/var` sub-...


3

This is the default context [root@server ftp]# ll -Zd upload/ drwxr-xr-x. root root unconfined_u:object_r:public_content_t:s0 upload/ I tried this command to change the context [root@server ftp]# semanage fcontext -a -t public_content_rw_t upload/ [root@server ftp]# ll -Zd upload/ drwxr-xr-x. root root unconfined_u:object_r:public_content_t:s0 upload/ [...


Only top voted, non community-wiki answers of a minimum length are eligible